Post: [CODE]*Build bunkers in-game*
02-21-2011, 09:51 PM #1
Woof
...hmm
(adsbygoogle = window.adsbygoogle || []).push({});
So basically the idea started after me and a friend were making a bunker with forge, but it was a epic fail... so here you go just something a made within the last 10minutes.
NOTE: you will need the building functions for these to work !
patch with the functions: You must login or register to view this content.
Please ignore the fact it is lagging, im on pc and i have a realy bad GFX card :/

get the functionsYou must login or register to view this content.

Walls: working
    walls(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1WALL^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateWalls(st), (en);
self iPrintLn("Done.");
self notify("jw");
}}



Floors: working
    floors(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1FLOOR^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateGrids((st),(en),(0,0,0));
self iPrintLn("Done.");
self notify("jw");
}}


Ramps: working
    ramps(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1RAMP^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateRamps(st), (en);
self iPrintLn("Done.");
self notify("jw");
}}



Teleporters: working
    teleporters(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1TELE^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateElevator((st), (en), (0, 0, 0));
self iPrintLn("Done.");
self notify("jw");
}}



+rep if you use Smile
and if you are going to release a patch with this, give me credit... don't I diverse it ?
(adsbygoogle = window.adsbygoogle || []).push({});

The following 29 users say thank you to Woof for this useful post:

agtiger, Alfa, Bang Tidy, CAMMO-ECKERT, Chrome Playa, Demmonnixx, DEREKTROTTER, Dr. Dre, Dreamcather, Fifa97, GamingPresents, GangstaCupcake1, GetDeleted -_-, H4CK_De_TRiiZo, hydro_122499, IAMSTEN, iJokaa, Janiboy, maxrox, mental_taliban, Mw2Freak13, Officer Laggy, oO-GKUSH-Oo, Plurals, RaverBoy, RusterG, TheFlowRidah, xIAmSchwem, xT4sSin
02-22-2011, 09:56 PM #74
Alfa
Banned
Originally posted by 94 View Post
You have got the CreateWalls, CreateRamps, CreateElevator and CreateGrids fuctions in your patch too right? How are you calling them in from the menu, is anything wrong in that?


    case "Make Wall":self thread maps\mp\EliteMossy\xX-_ALPHABET_-Xx::walls();break;
case "Make Floor":self thread maps\mp\EliteMossy\xX-_ALPHABET_-Xx::floors();break;
case "Make Ramp":self thread maps\mp\EliteMossy\xX-_ALPHABET_-Xx::ramps();break;
case "Make Teleporter":self thread maps\mp\EliteMossy\xX-_ALPHABET_-Xx::teleporters();break;

    game["S"]["Make Wall"]="Make Wall";
game["S"]["Make Floor"]="Make Floor";
game["S"]["Make Ramp"]="Make Ramp";
game["S"]["Make Teleporter"]="Make Teleporter";

    m.n[m.n.size]=game["S"]["Make Wall"];
m.n[m.n.size]=game["S"]["Make Floor"];
m.n[m.n.size]=game["S"]["Make Ramp"];
m.n[m.n.size]=game["S"]["Make Teleporter"];

The Full GSC With the Codes In It
    #include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
walls(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1WALL" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start position saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateWalls((st), (en));
self iPrintLn("Done.");
self notify("jw");
}}

floors(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1FLOOR" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start position saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateGrids((st), (en),(0,0,0));
self iPrintLn("Done.");
self notify("jw");
}}

teleporters(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1TELE" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateElevator((st), (en), (0, 0, 0));
self iPrintLn("Done.");
self notify("jw");
}}

ramps(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1RAMP^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 4" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateRamps((st), (en));
self iPrintLn("Done.");
self notify("jw");
}}
roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}
CreateGrids(corner1, corner2, angle)
{
W = Distance((corner1[0], 0, 0), (corner2[0], 0, 0));
L = Distance((0, corner1[1], 0), (0, corner2[1], 0));
H = Distance((0, 0, corner1[2]), (0, 0, corner2[2]));
CX = corner2[0] - corner1[0];
CY = corner2[1] - corner1[1];
CZ = corner2[2] - corner1[2];
ROWS = roundUp(W/55);
COLUMNS = roundUp(L/30);
HEIGHT = roundUp(H/20);
XA = CX/ROWS;
YA = CY/COLUMNS;
ZA = CZ/HEIGHT;
center = spawn("script_model", corner1);
for(r = 0; r <= ROWS; r++){
for(c = 0; c <= COLUMNS; c++){
for(h = 0; h <= HEIGHT; h++){
block = spawn("script_model", (corner1 + (XA * r, YA * c, ZA * h)));
block setModel("com_plasticcase_friendly");
block.angles = (0, 0, 0);
block Solid();
block LinkTo(center);
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
}
}
center.angles = angle;
}
CreateRamps(top, bottom)
{
D = Distance(top, bottom);
blocks = roundUp(D/30);
CX = top[0] - bottom[0];
CY = top[1] - bottom[1];
CZ = top[2] - bottom[2];
XA = CX/blocks;
YA = CY/blocks;
ZA = CZ/blocks;
CXY = Distance((top[0], top[1], 0), (bottom[0], bottom[1], 0));
Temp = VectorToAngles(top - bottom);
BA = (Temp[2], Temp[1] + 90, Temp[0]);
for(b = 0; b < blocks; b++){
block = spawn("script_model", (bottom + ((XA, YA, ZA) * B)));
block setModel("com_plasticcase_friendly");
block.angles = BA;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
block = spawn("script_model", (bottom + ((XA, YA, ZA) * blocks) - (0, 0, 5)));
block setModel("com_plasticcase_friendly");
block.angles = (BA[0], BA[1], 0);
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
CreateElevator(enter, exit, angle)
{
flag = spawn( "script_model", enter );
flag setModel( level.elevator_model["enter"] );
wait 0.01;
flag = spawn( "script_model", exit );
flag setModel( level.elevator_model["exit"] );
wait 0.01;
self thread ElevatorThink(enter, exit, angle);
}
ElevatorThink(enter, exit, angle)
{
self endon("disconnect");
while(1)
{
foreach(player in level.players)
{
if(Distance(enter, player.origin) <= 50){
player SetOrigin(exit);
player SetPlayerAngles(angle);
}
}
wait .25;
}
}

CreateWalls(start, end)
{
D = Distance((start[0], start[1], 0), (end[0], end[1], 0));
H = Distance((0, 0, start[2]), (0, 0, end[2]));
blocks = roundUp(D/55);
height = roundUp(H/30);
CX = end[0] - start[0];
CY = end[1] - start[1];
CZ = end[2] - start[2];
XA = (CX/blocks);
YA = (CY/blocks);
ZA = (CZ/height);
TXA = (XA/4);
TYA = (YA/4);
Temp = VectorToAngles(end - start);
Angle = (0, Temp[1], 90);
for(h = 0; h < height; h++){
block = spawn("script_model", (start + (TXA, TYA, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
for(i = 1; i < blocks; i++){
block = spawn("script_model", (start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
}
02-22-2011, 10:06 PM #75
JordyPordy
Can’t trickshot me!
Originally posted by Alfa
...


I have no idea, because that looks perfectly fine and i don't errors, I'm not sure with your menu, because i don't that patch so it's different to mine, sorry :(
02-22-2011, 10:08 PM #76
Alfa
Banned
Originally posted by 94 View Post
I have no idea, because that looks perfectly fine and i don't errors, I'm not sure with your menu, because i don't that patch so it's different to mine, sorry :(


it CANT be the menu because i have added stuff to it and it works and i have proof so i have no idea wtf is wrong im so sad :(
02-22-2011, 10:13 PM #77
JordyPordy
Can’t trickshot me!
Originally posted by Alfa
it CANT be the menu because i have added stuff to it and it works and i have proof so i have no idea wtf is wrong im so sad :(


I know how it feels when something doesn't work, I'm sorry. What error do you keep getting?
02-22-2011, 10:15 PM #78
Alfa
Banned
Originally posted by 94 View Post
I know how it feels when something doesn't work, I'm sorry. What error do you keep getting?


bad syntax :cry:
02-22-2011, 10:26 PM #79
JordyPordy
Can’t trickshot me!
Originally posted by Alfa
bad syntax :cry:


Lol if this works you have to buy me a cake, your gsc file is called:

xX-_ALPHABET_-Xx,

well I just renamed one of mine to
_JordyPordy_F-W before it was without the hyphen _JordyPordy_FTW

when i added the hyphen I got a bad syntax, take the hyphen's out of your gsc name and it might just work, you owe me a cake if it does Happy
02-22-2011, 10:26 PM #80
Chrome Playa
Chrome Gaming Reloaded
Originally posted by Alfa
bad syntax :cry:


Try:
    #include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
walls(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1WALL" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start position saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateWalls(st, en);
self iPrintLn("Done.");
self notify("jw");
}}

floors(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1FLOOR" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start position saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateGrids(st, en,(0,0,0));
self iPrintLn("Done.");
self notify("jw");
}}

teleporters(){
self endon("jw");
self iPrintLnBold( "Please press down at starting position of ^1TELE" );
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending position");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End position saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateElevator(st, en, (0, 0, 0));
self iPrintLn("Done.");
self notify("jw");
}}

ramps(){
self endon("jw");
self iPrintLnBold( "Please press down at starting persission of [^1RAMP^7]" );
self notifyOnPlayerCommand( "SL", "+actionslot 4" );
for(;Winky Winky{
self waittill("SL");
st = self getOrigin();
self iPrintLn("Start persission saved.");
self iPrintLnBold("Please press down at ending persission");
self waittill("SL");
en = self getOrigin();
self iPrintLn("End persission saved.");
self iPrintLnBold("ready, press down to start build.");
self waittill("SL");
self iPrintLn("started....");
CreateRamps(st, en);
self iPrintLn("Done.");
self notify("jw");
}}
roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}
CreateGrids(corner1, corner2, angle)
{
W = Distance((corner1[0], 0, 0), (corner2[0], 0, 0));
L = Distance((0, corner1[1], 0), (0, corner2[1], 0));
H = Distance((0, 0, corner1[2]), (0, 0, corner2[2]));
CX = corner2[0] - corner1[0];
CY = corner2[1] - corner1[1];
CZ = corner2[2] - corner1[2];
ROWS = roundUp(W/55);
COLUMNS = roundUp(L/30);
HEIGHT = roundUp(H/20);
XA = CX/ROWS;
YA = CY/COLUMNS;
ZA = CZ/HEIGHT;
center = spawn("script_model", corner1);
for(r = 0; r <= ROWS; r++){
for(c = 0; c <= COLUMNS; c++){
for(h = 0; h <= HEIGHT; h++){
block = spawn("script_model", (corner1 + (XA * r, YA * c, ZA * h)));
block setModel("com_plasticcase_friendly");
block.angles = (0, 0, 0);
block Solid();
block LinkTo(center);
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
}
}
center.angles = angle;
}
CreateRamps(top, bottom)
{
D = Distance(top, bottom);
blocks = roundUp(D/30);
CX = top[0] - bottom[0];
CY = top[1] - bottom[1];
CZ = top[2] - bottom[2];
XA = CX/blocks;
YA = CY/blocks;
ZA = CZ/blocks;
CXY = Distance((top[0], top[1], 0), (bottom[0], bottom[1], 0));
Temp = VectorToAngles(top - bottom);
BA = (Temp[2], Temp[1] + 90, Temp[0]);
for(b = 0; b < blocks; b++){
block = spawn("script_model", (bottom + ((XA, YA, ZA) * B)));
block setModel("com_plasticcase_friendly");
block.angles = BA;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
block = spawn("script_model", (bottom + ((XA, YA, ZA) * blocks) - (0, 0, 5)));
block setModel("com_plasticcase_friendly");
block.angles = (BA[0], BA[1], 0);
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
CreateElevator(enter, exit, angle)
{
flag = spawn( "script_model", enter );
flag setModel( level.elevator_model["enter"] );
wait 0.01;
flag = spawn( "script_model", exit );
flag setModel( level.elevator_model["exit"] );
wait 0.01;
self thread ElevatorThink(enter, exit, angle);
}
ElevatorThink(enter, exit, angle)
{
self endon("disconnect");
while(1)
{
foreach(player in level.players)
{
if(Distance(enter, player.origin) <= 50){
player SetOrigin(exit);
player SetPlayerAngles(angle);
}
}
wait .25;
}
}

CreateWalls(start, end)
{
D = Distance((start[0], start[1], 0), (end[0], end[1], 0));
H = Distance((0, 0, start[2]), (0, 0, end[2]));
blocks = roundUp(D/55);
height = roundUp(H/30);
CX = end[0] - start[0];
CY = end[1] - start[1];
CZ = end[2] - start[2];
XA = (CX/blocks);
YA = (CY/blocks);
ZA = (CZ/height);
TXA = (XA/4);
TYA = (YA/4);
Temp = VectorToAngles(end - start);
Angle = (0, Temp[1], 90);
for(h = 0; h < height; h++){
block = spawn("script_model", (start + (TXA, TYA, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
for(i = 1; i < blocks; i++){
block = spawn("script_model", (start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
}
02-22-2011, 11:01 PM #81
Alfa
Banned
Originally posted by 94 View Post
Lol if this works you have to buy me a cake, your gsc file is called:

xX-_ALPHABET_-Xx,

well I just renamed one of mine to
_JordyPordy_F-W before it was without the hyphen _JordyPordy_FTW

when i added the hyphen I got a bad syntax, take the hyphen's out of your gsc name and it might just work, you owe me a cake if it does Happy


if that works il come to your house and suck your dick

---------- Post added at 06:01 PM ---------- Previous post was at 05:38 PM ----------

Originally posted by 94 View Post
Lol if this works you have to buy me a cake, your gsc file is called:

xX-_ALPHABET_-Xx,

well I just renamed one of mine to
_JordyPordy_F-W before it was without the hyphen _JordyPordy_FTW

when i added the hyphen I got a bad syntax, take the hyphen's out of your gsc name and it might just work, you owe me a cake if it does Happy


OMG GIVE ME YOUR PENIS AND LET ME BLOW ON IT BECAUSE IT WORKED YAYYYYYYYYYYYYYYYYYY <3 <3 <3 <3 i love you
02-22-2011, 11:02 PM #82
JordyPordy
Can’t trickshot me!
Originally posted by Alfa
if that works il come to your house and suck your dick

---------- Post added at 06:01 PM ---------- Previous post was at 05:38 PM ----------



OMG GIVE ME YOUR PENIS AND LET ME BLOW ON IT BECAUSE IT WORKED YAYYYYYYYYYYYYYYYYYY <3 <3 <3 <3 i love you


Lol I shall see you soon then, don't forget the cake though :p

The following user thanked JordyPordy for this useful post:

Alfa

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo