Post: [code]Spawn Tatical in game Includes doors
02-26-2011, 04:34 AM #1
emsp
Space Ninja
(adsbygoogle = window.adsbygoogle || []).push({}); I modified Chrome Playa Code to Work with tactical insertion and doors

i did not make this code i just made it work with the stuff i needed it to work with

Doors
    

BuildDoor(){
self thread Build3Upside Down Happy:CreateDoors, "Door", "CreateDoors", (90, 0, 0), 3, 2, 100, 75);
}
BuildDoor2(){
self thread Build3Upside Down Happy:CreateDoors, "Door 180", "CreateDoors", (90, 90, 0), 3, 2, 100, 75);
}


^^^^^^Call From menu i made to Doors For Different Angles

    
Build3(function, type, functiontype, angle, size, height, hp, range){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Start Your "+type);
self thread DestroyOnDeath(instruct2);
self waittill("SL");
end = self GetOrigin();
self iPrintLnBold("End Position Saved.");
instruct2 destroy();
instruct3 = self createFontString("hudbig", 1);
instruct3 setPoint("TOP");
instruct3 setText("^2Press [{+actionslot 2}] to End Your "+type);
self thread DestroyOnCancel(instruct3,"cw");
self thread DestroyOnDeath(instruct3);
self waittill("SL");
instruct3 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start, end, angle, size, height, hp, range);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+", "+end+", "+angle+", "+size+", "+height+", "+hp+", "+range+" );");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


For Tacticals
     
Tack(){
self thread BuildTacUpside Down Happy:CreateTac, "Tactical Insertion", "CreateTac");
}

^^^^^^call this from menu

    
BuildTac(function, type, functiontype){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Build Your "+type);
self thread DestroyOnCancel(instruct2,"cw");
self thread DestroyOnDeath(instruct2);
self waittill("SL");
instruct2 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+");");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


Needed Functions
    
CreateTac(pos)
{
efx = loadfx( "misc/flare_ambient" );
playFx( efx, pos );
wait 0.01;
}

Doors\\\\\\\

CreateDoors(open,close,angle,size,height,hp,range){ offset =(((size / 2)- 0.5)* -1); center=spawn("script_model",open); for(j=0;j < size;j++){ door=spawn("script_model",open +((0,30,0)* offset)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); for(h=1;h < height;h++){ door=spawn("script_model",open +((0,30,0)* offset)-((70,0,0)* h)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); } offset += 1; } center.angles=angle; center.state="open"; center.hp=hp; center.range=range; center thread DoorThink(open,close); center thread DoorUse(); center thread ResetDoors(open,hp); wait 0.01;} DoorThink(open,close){ while(1) { if(self.hp > 0){ self waittill("triggeruse" ,player); if(player.team=="allies"){ if(self.state=="open"){ self MoveTo(close,level.doorwait); wait level.doorwait; self.state="close"; continue; } if(self.state=="close"){ self MoveTo(open,level.doorwait); wait level.doorwait; self.state="open"; continue; } } if(player.team=="axis"){ if(self.state=="close"){ self.hp--; player iPrintlnBold("HIT"); wait 1; continue; } } }else{ if(self.state=="close"){ self MoveTo(open,level.doorwait); } self.state="broken"; wait .5; } }} DoorUse(range){ self endon("disconnect"); while(1) { foreach(player in level.players) { if(Distance(self.origin,player.origin)<= self.range){ if(player.team=="allies"){ if(self.state=="open"){ player.hint="Press ^3[{+activate}] ^7to ^2Close ^7the door"; } if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Open ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.team=="axis"){ if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Attack ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.buttonPressed[ "+activate" ]==1){ player.buttonPressed[ "+activate" ]=0; self notify("triggeruse" ,player); } } } wait .045; }} ResetDoors(open,hp){ while(1) { level waittill("RESETDOORS"); self.hp=hp; self MoveTo(open,level.doorwait); self.state="open"; }}




Others\\\\\\
DestroyOnDeath(text){
self waittill("death");
text destroy();}
DestroyOnCancel(text,not){
self waittill(not);
text destroy();}

endOnCancel(not){
self notifyOnPlayerCommand( "canc", "+actionslot 4" );
for(;Winky Winky{
self waittill("canc");
self notify(not);}}



I think Thats all
(adsbygoogle = window.adsbygoogle || []).push({});
02-26-2011, 09:55 AM #11
Woof
...hmm
Originally posted by emsp View Post
im lost here????


Hahahh thats pretty epic

nvm lol wana help me on my new project ?
its a big one... lets just say you wouldn't be able to fit it into a menu patch.
02-26-2011, 09:56 AM #12
emsp
Space Ninja
Originally posted by BadMan
nvm lol wana help me on my new project ?
its a big one... lets just say you wouldn't be able to fit it into a menu patch.


sounds Like Fun Im in lol

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo