Post: Some Forge Codes
10-05-2014, 04:02 PM #1
alex-_-123
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); Credits to Taylor for the amazing YARDSALE patch in the good old mw2 days, which is where I got the code from to convert. Smile
Edit: I know that the elevator doesn't work properly if someone wants to get it workin i will add it to the thread and provide credits. Thanks!


Make sure to add these to init()
precacheModel("t6_wpn_supply_drop_ally");
precacheModel("mp_flag_green");
precacheModel("mp_flag_red");


    
ForgeRamp()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Ramp...");
wait 2;
level thread CreateRamp(pos1,pos2);
self iPrintln("^2Ramp Done!");
self notify("doneforge");
}
}




CreateRamp(top,bottom)
{
D=Distance(top,bottom);
blocks=xxroundUp(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("t6_wpn_supply_drop_ally");
block.angles=BA;
blockb=spawn("trigger_radius",(0,0,0),0,65,30);
blockb.origin=block.origin+(0,0,5);
blockb.angles=BA;
blockb setContents(1);
wait 0.01;
}
block=spawn("script_model",(bottom +((XA,YA,ZA)* blocks)-(0,0,5)));
block setModel("t6_wpn_supply_drop_ally");
block.angles =(BA[0],BA[1],0);
blockb=spawn("trigger_radius",(0,0,0),0,65,30);
blockb.origin=block.origin+(0,0,5);
blockb.angles =(BA[0],BA[1],0);
blockb setContents(1);
wait 0.01;
}



ForgeWall()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Wall \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Wall \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Wall...");
wait 2;
level thread CreateWall(pos1,pos2);
self iPrintln("^2Wall Done!");
self notify("doneforge");
}
}




CreateWall(top,bottom)
{
blockb=[];
blockc=[];
D=Distance((top[0],top[1],0),(bottom[0],bottom[1],0));
H=Distance((0,0,top[2]),(0,0,bottom[2]));
blocks=xxroundUp(D / 40);
height=xxroundUp(H / 40);
CX=bottom[0] - top[0];
CY=bottom[1] - top[1];
CZ=bottom[2] - top[2];
XA=CX / blocks;
YA=CY / blocks;
ZA=CZ / height;
TXA=(XA / 4);
TYA=(YA / 4);
Temp=VectorToAngles(bottom - top);
BA =(0,Temp[1],90);
for(h=0;h < height;h++)
{
fstpos=(top+(TXA,TYA,10)+((0,0,ZA)* h));
block=spawn("script_model",fstpos);
block setModel("t6_wpn_supply_drop_ally");
block.angles=BA;
blockb[h]=spawn("trigger_radius",(0,0,0),0,75,40);
blockb[h].origin=fstpos;
blockb[h].angles=BA;
blockb[h] setContents(1);
wait 0.001;
for(i=0;i < blocks;i++)
{
secpos=(top +((XA,YA,0)* i)+(0,0,10)+((0,0,ZA)* h));
block=spawn("script_model",secpos);
block setModel("t6_wpn_supply_drop_ally");
block.angles =BA;
blockc[i]=spawn("trigger_radius",(0,0,0),0,75,40);
blockc[i].origin=secpos;
blockc[i].angles=BA;
blockc[i] setContents(1);
wait 0.001;
}
}
}


ForgeGrids()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of Grid \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of Grid \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Grid...");
wait 2;
level thread CreateGrids(pos1,pos2);
self iPrintln("^2Grid Done!");
self notify("doneforge");
}
}


CreateGrids(corner1,corner2,angle)
{
blockfloor=[];
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=xxroundUp(W / 40);
COLUMNS=xxroundUp(L / 55);
HEIGHT=xxroundUp(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++)
{
floor=(corner1 +(XA * r, YA * c, ZA * h));
block=spawn("script_model",floor);
block setModel("t6_wpn_supply_drop_ally");
block.angles =(0,0,0);
block LinkTo(center);
blockfloor[h]=spawn("trigger_radius",(0,0,0),0,65,30);
blockfloor[h].origin=floor;
blockfloor[h].angles=(0,90,0);
blockfloor[h] setContents(1);
}
}
}
center.angles=angle;
}



ForgeTele()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Teleporter...");
wait 2;
level thread CreateFlag(pos1,pos2);
self iPrintln("^2Elevator Done!");
self notify("doneforge");
}
}


CreateFlag(enter,exit,vis,radius,angle)
{
if(!isDefined(vis))vis=0;
if(!isDefined(angle))angle =(0,0,0);
flag=spawn("script_model",enter);
flag setModel("mp_flag_green");
flag.angles=angle;
if(vis==0)
{
col="objective";
flag xxshowInMap(col);
wait 0.01;
flag=spawn("script_model",exit);
flag setModel("mp_flag_red");
}
wait 0.01;
self thread xxElevatorThink(enter,exit,radius,angle);
}
xxElevatorThink(enter,exit,radius,angle)
{
level endon("GEND");
if(!isDefined(radius))radius=50;
while(1)
{
for(i=0;i< level.players.size;i++)
{
p=level.players[i];
if(Distance(enter,p.origin)<= radius)
{
p SetOrigin(exit);
p SetPlayerAngles(angle);
if(p.team=="axis")p thread xxSpNorm(0.1,1.7,1);
if(isDefined(p.elvz))p.elvz++;
}
}
wait .5;
}
}
xxshowInMap(shader)
{
}


xxSpNorm(slow,time,acc,li)
{
self endon("death");
self endon("disconnect");
if(!isDefined(li))li=0;
if(self.lght==1 && li==0)return;
if(!isDefined(acc))acc=0;
self SetMoveSpeedScale(slow);
wait time;
for(;Winky Winky
{
if(acc==0)break;
slow =(slow + 0.1);
self SetMoveSpeedScale(slow);
if(slow==1.0)break;
wait .15;
}
self thread xxLWSP();
}
xxLWSP()
{
self SetMoveSpeedScale(1.0);
if(self.lght==1)self SetMoveSpeedScale(1.4);
}








ForgeLifts()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Teleporter...");
wait 2;
level thread CreateLift(pos1,pos2);
self iPrintln("^2Elevator Done!");
self notify("doneforge");
}
}


CreateLift(pos,height)
{
lift=spawn("script_model",pos);
lift setModel("t6_wpn_supply_drop_axis");
wait .05;
lift.angles =(0,0,270);
wait .05;
lift thread ForgeLiftUp(pos,height);
}
ForgeLiftUp(pos,height)
{
level endon("GEND");
while(1)
{
players=level.players;
for(index=0;index < players.size;index++)
{
player=players[index];
if(Distance(pos,player.origin)<= 50)
{
player setOrigin(pos);
player thread ForgeLiftAct(pos,height);
wait 3;
}
wait 0.01;
}
wait 1;
}
}
ForgeLiftAct(pos,height)
{
self endon("death");
self endon("disconnect");
self endon("ZBSTART");
self.liftz=1;
posa=self.origin;
fpos=posa[2] + height;
h=0;
for(j=1;self.origin[2] < fpos;j+=j)
{
if(j > 130)j=130;
h=h+j;
self SetOrigin((pos)+(0,0,h));
wait .1;
}
vec=anglestoforward(self getPlayerAngles());
end =(vec[0] * 160,vec[1] * 160,vec[2] * 10);
self SetOrigin(self.origin + end);
wait .2;
posz=self.origin;
wait 4;
self.liftz=0;
if(self.origin==posz)self SetOrigin(posa);
}

xxroundUp(floatVal)
{
if(int(floatVal)!= floatVal)return int(floatVal+1);
else return int(floatVal);
}



Credits to SyGnUs for the spawn weapon code i just made it so it spawns the ballista in the position where you are standing when you shoot. Smile
But make sure to add this to one of your sub menu's!
    
self add_option("Forge", "Spawn Ballista", ::doWeapon);



    
SpawnWeapon(WFunc,Weapon,WeaponName,Location,TakeOnce)
{
self endon("disconnect");
weapon_model = getWeaponModel(Weapon);
if(weapon_model=="")weapon_model=Weapon;
Wep=spawn("script_model",Location+(0,0,0));
Wep setModel(weapon_model);
for(;Winky Winky
{
foreach(player in level.players)
{
Radius=distance(Location,player.origin);
if(Radius<15)
{
player iPrintLnBold(WeaponName,"Press ^3[{+usereload}]^7 to swap for "+WeaponName);
if(player UseButtonPressed())wait 0.2;
if(player UseButtonPressed())
{
if(!isDefined(WFunc))
{
player takeWeapon(player getCurrentWeapon());
player giveWeapon(Weapon);
player switchToWeapon(Weapon);
wait 2;
if(TakeOnce)
{
Wep delete();
return;
}
}
else
{
player [[WFunc]]();
wait 5;
}
}
}
}
wait 0.5;
}
}





doWeapon()
{
self endon("death");
self endon("doneweapon");
for(;Winky Winky
{
self iPrintlnBold("^2Press [{+attack}] To Mark Spawn Location");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 2;
self thread SpawnWeapon(undefined,"ballista_mp","Press ^3[{+usereload}]^7 to swap for Ballista",pos1,0);
self iPrintln("^2Weapon Spawned");
self notify("doneweapon");
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to alex-_-123 for this useful post:

-Numb, iifire, Loz, My Ninja Defuse, TehMerkMods, Tipton_Modz

The following user groaned alex-_-123 for this awful post:

John
10-05-2014, 09:48 PM #20
Sync
The (ONE) Above!
I freeze all the time can't find a way around it..
10-06-2014, 12:32 AM #21
Thirst
Error… Cat invasion!
Originally posted by Unboundh4x View Post
Jurriaan.kolk is my skype


I added you ^^
10-06-2014, 04:23 AM #22
Shark
Retired.
Originally posted by ReFleX
u dont freeze?


Originally posted by 123 View Post
Nope, I'm using sharks menu base with my advanced forge which i posted on itsLollo's thread.


Originally posted by ReFleX
ok uhm whats your skype? maybe u can help me cuz i freeze


Originally posted by x0ptic0ns100 View Post
I am still freezing


Originally posted by 123 View Post
My Skype is alex_megablocks i don't know whether I'll be able to help because I don't know what's wrong, I haven't froze yet, online on ps3 with friends.


lol where is the credit to the original maker?

You must login or register to view this content.

it looks like you just copied and pasted from this thread No

The following user thanked Shark for this useful post:

SyGnUs
10-06-2014, 04:30 AM #23
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by Shark View Post
lol where is the credit to the original maker?

You must login or register to view this content.

it looks like you just copied and pasted from this thread No


He probably ended up copying this one - You must login or register to view this content.

Doesn't make a difference though.
10-06-2014, 04:43 AM #24
Shark
Retired.
and people are wondering why it doesn't work and freezes Needa
10-06-2014, 05:58 AM #25
Originally posted by 123 View Post
Make sure to add these to init()
precacheModel("t6_wpn_supply_drop_ally");
precacheModel("mp_flag_green");
precacheModel("mp_flag_red");


    
ForgeRamp()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Ramp...");
wait 2;
level thread CreateRamp(pos1,pos2);
self iPrintln("^2Ramp Done!");
self notify("doneforge");
}
}




CreateRamp(top,bottom)
{
D=Distance(top,bottom);
blocks=xxroundUp(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("t6_wpn_supply_drop_ally");
block.angles=BA;
blockb=spawn("trigger_radius",(0,0,0),0,65,30);
blockb.origin=block.origin+(0,0,5);
blockb.angles=BA;
blockb setContents(1);
wait 0.01;
}
block=spawn("script_model",(bottom +((XA,YA,ZA)* blocks)-(0,0,5)));
block setModel("t6_wpn_supply_drop_ally");
block.angles =(BA[0],BA[1],0);
blockb=spawn("trigger_radius",(0,0,0),0,65,30);
blockb.origin=block.origin+(0,0,5);
blockb.angles =(BA[0],BA[1],0);
blockb setContents(1);
wait 0.01;
}



ForgeWall()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Wall \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Wall \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Wall...");
wait 2;
level thread CreateWall(pos1,pos2);
self iPrintln("^2Wall Done!");
self notify("doneforge");
}
}




CreateWall(top,bottom)
{
blockb=[];
blockc=[];
D=Distance((top[0],top[1],0),(bottom[0],bottom[1],0));
H=Distance((0,0,top[2]),(0,0,bottom[2]));
blocks=xxroundUp(D / 40);
height=xxroundUp(H / 40);
CX=bottom[0] - top[0];
CY=bottom[1] - top[1];
CZ=bottom[2] - top[2];
XA=CX / blocks;
YA=CY / blocks;
ZA=CZ / height;
TXA=(XA / 4);
TYA=(YA / 4);
Temp=VectorToAngles(bottom - top);
BA =(0,Temp[1],90);
for(h=0;h < height;h++)
{
fstpos=(top+(TXA,TYA,10)+((0,0,ZA)* h));
block=spawn("script_model",fstpos);
block setModel("t6_wpn_supply_drop_ally");
block.angles=BA;
blockb[h]=spawn("trigger_radius",(0,0,0),0,75,40);
blockb[h].origin=fstpos;
blockb[h].angles=BA;
blockb[h] setContents(1);
wait 0.001;
for(i=0;i < blocks;i++)
{
secpos=(top +((XA,YA,0)* i)+(0,0,10)+((0,0,ZA)* h));
block=spawn("script_model",secpos);
block setModel("t6_wpn_supply_drop_ally");
block.angles =BA;
blockc[i]=spawn("trigger_radius",(0,0,0),0,75,40);
blockc[i].origin=secpos;
blockc[i].angles=BA;
blockc[i] setContents(1);
wait 0.001;
}
}
}


ForgeGrids()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of Grid \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of Grid \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Grid...");
wait 2;
level thread CreateGrids(pos1,pos2);
self iPrintln("^2Grid Done!");
self notify("doneforge");
}
}


CreateGrids(corner1,corner2,angle)
{
blockfloor=[];
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=xxroundUp(W / 40);
COLUMNS=xxroundUp(L / 55);
HEIGHT=xxroundUp(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++)
{
floor=(corner1 +(XA * r, YA * c, ZA * h));
block=spawn("script_model",floor);
block setModel("t6_wpn_supply_drop_ally");
block.angles =(0,0,0);
block LinkTo(center);
blockfloor[h]=spawn("trigger_radius",(0,0,0),0,65,30);
blockfloor[h].origin=floor;
blockfloor[h].angles=(0,90,0);
blockfloor[h] setContents(1);
}
}
}
center.angles=angle;
}



ForgeTele()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Teleporter...");
wait 2;
level thread CreateFlag(pos1,pos2);
self iPrintln("^2Elevator Done!");
self notify("doneforge");
}
}


CreateFlag(enter,exit,vis,radius,angle)
{
if(!isDefined(vis))vis=0;
if(!isDefined(angle))angle =(0,0,0);
flag=spawn("script_model",enter);
flag setModel("mp_flag_green");
flag.angles=angle;
if(vis==0)
{
col="objective";
flag xxshowInMap(col);
wait 0.01;
flag=spawn("script_model",exit);
flag setModel("mp_flag_red");
}
wait 0.01;
self thread xxElevatorThink(enter,exit,radius,angle);
}
xxElevatorThink(enter,exit,radius,angle)
{
level endon("GEND");
if(!isDefined(radius))radius=50;
while(1)
{
for(i=0;i< level.players.size;i++)
{
p=level.players[i];
if(Distance(enter,p.origin)<= radius)
{
p SetOrigin(exit);
p SetPlayerAngles(angle);
if(p.team=="axis")p thread xxSpNorm(0.1,1.7,1);
if(isDefined(p.elvz))p.elvz++;
}
}
wait .5;
}
}
xxshowInMap(shader)
{
}


xxSpNorm(slow,time,acc,li)
{
self endon("death");
self endon("disconnect");
if(!isDefined(li))li=0;
if(self.lght==1 && li==0)return;
if(!isDefined(acc))acc=0;
self SetMoveSpeedScale(slow);
wait time;
for(;Winky Winky
{
if(acc==0)break;
slow =(slow + 0.1);
self SetMoveSpeedScale(slow);
if(slow==1.0)break;
wait .15;
}
self thread xxLWSP();
}
xxLWSP()
{
self SetMoveSpeedScale(1.0);
if(self.lght==1)self SetMoveSpeedScale(1.4);
}








ForgeLifts()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos1=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Teleporter \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
pos2=self.origin;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Teleporter...");
wait 2;
level thread CreateLift(pos1,pos2);
self iPrintln("^2Elevator Done!");
self notify("doneforge");
}
}


CreateLift(pos,height)
{
lift=spawn("script_model",pos);
lift setModel("t6_wpn_supply_drop_axis");
wait .05;
lift.angles =(0,0,270);
wait .05;
lift thread ForgeLiftUp(pos,height);
}
ForgeLiftUp(pos,height)
{
level endon("GEND");
while(1)
{
players=level.players;
for(index=0;index < players.size;index++)
{
player=players[index];
if(Distance(pos,player.origin)<= 50)
{
player setOrigin(pos);
player thread ForgeLiftAct(pos,height);
wait 3;
}
wait 0.01;
}
wait 1;
}
}
ForgeLiftAct(pos,height)
{
self endon("death");
self endon("disconnect");
self endon("ZBSTART");
self.liftz=1;
posa=self.origin;
fpos=posa[2] + height;
h=0;
for(j=1;self.origin[2] < fpos;j+=j)
{
if(j > 130)j=130;
h=h+j;
self SetOrigin((pos)+(0,0,h));
wait .1;
}
vec=anglestoforward(self getPlayerAngles());
end =(vec[0] * 160,vec[1] * 160,vec[2] * 10);
self SetOrigin(self.origin + end);
wait .2;
posz=self.origin;
wait 4;
self.liftz=0;
if(self.origin==posz)self SetOrigin(posa);
}

xxroundUp(floatVal)
{
if(int(floatVal)!= floatVal)return int(floatVal+1);
else return int(floatVal);
}


So I got it all working but the only weird thing is the Elevator you stand on it and you just keep flying up in the air lol. And if you don't build both the grid corners at the same height it will kick you and tell you no free entity's. But other than that it all works.
10-06-2014, 10:45 AM #26
jwm614
NextGenUpdate Elite
Originally posted by My
So I got it all working but the only weird thing is the Elevator you stand on it and you just keep flying up in the air lol. And if you don't build both the grid corners at the same height it will kick you and tell you no free entity's. But other than that it all works.


here this one works good i have it tin my forge menu

    
forgegrid()
{
self endon("death");
self endon("doneforge");
for(;Winky Winky
{
self iPrintlnBold("^2Go To The Start Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");

vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
location = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
pos1=location;
wait .1;
self iPrintln("^2Position Marked!");
wait 1;
self iPrintlnBold("^2Go To The End Position Of The Ramp \n^2Press [{+attack}] To Mark");
self waittill("weapon_fired");
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
location = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
pos2=location;
wait .1;
self iPrintln("^2Position Marked!");
self iPrintlnBold("^2Creating Wall...");
wait 2;
angle = (0,0,0);
self thread CreateGrids(pos1,pos2,angle);
self iPrintln("^2Wall Done!");
self notify("doneforge");
}
}


CreateGrids(corner1,corner2,angle)
{
w1 = (corner1[0],0,0);
w2 = (corner2[0],0,0);
l1 = (0,corner1[1],0);
l2 = (0,corner2[1],0);
h1 = (0,0,corner1[2]);
h2 = (0,0,corner1[2]);
W=Distance(w1,w2);
L=Distance(l1,l2);
H=Distance(h1,h2);
CX=corner2[0] - corner1[0];
CY=corner2[1] - corner1[1];
CZ=corner2[2] - corner1[2];
ROWS=roundUp(W / 40);
COLUMNS=roundUp(L / 70);
HEIGHT=roundUp(H / 40);
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("t6_wpn_supply_drop_ally");
block.angles =(0,0,0);
wait 0.01;
}
}
}
center.angles=angle;
}

roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}


You must login or register to view this content.

I made the same bunker like in my mw3 tool too if some one once it I'll post the code
10-06-2014, 02:56 PM #27
alex-_-123
Do a barrel roll!
Originally posted by Shark View Post
and people are wondering why it doesn't work and freezes Needa

Actually it works perfectly for me except from the elevator which just takes you up forever and i copy and pasted it from the yardsale patch but forgot to add credit which i will do now.
10-06-2014, 02:57 PM #28
Shark
Retired.
good job m8

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo