zOlymP
Well-Known Member
- Messages
- 55
- Reaction score
- 28
- Points
- 228
I need help the code freez my Console anytime how i can fix it ?
Code:
tgride()
{
self.rdi = BO(self.rdi);
self iprintln("Kid Ride ^2Spawned");
if(self.rdi) self thread kidride();
self endon("rdi");
}
kidride()
{
self endon("rdi");
level endon("game_ended");
spawnPosition=self.origin + (50,25,10);
a=spawn("script_model",spawnPosition);
a setModel("t6_wpn_supply_drop_ally");
a.angles = (45,0,0);
b=spawn("script_model",spawnPosition);
b setModel("t6_wpn_supply_drop_axis");
b linkTo(a,"",(-40,0,0),(0,0,0));
c=spawn("script_model",spawnPosition);
c setModel("t6_wpn_supply_drop_hq");
c linkTo(b,"",(-40,0,0),(0,0,0));
d=spawn("script_model",spawnPosition);
d setModel("t6_wpn_supply_drop_ally");
d linkTo(c,"",(-40,0,0),(0,0,0));
e=spawn("script_model",spawnPosition);
e setModel("t6_wpn_supply_drop_axis");
e linkTo(d,"",(-40,0,0),(0,0,0));
f=spawn("script_model",spawnPosition);
f setModel("t6_wpn_supply_drop_hq");
f linkTo(e,"",(-40,0,0),(0,0,0));
g=spawn("script_model",spawnPosition);
g setModel("t6_wpn_supply_drop_ally");
g linkTo(f,"",(-40,0,0),(0,0,0));
h=spawn("script_model",spawnPosition);
h setModel("veh_t6_drone_uav");
h linkTo(g,"",(-30,0,0),(-90,0,0));
self thread monitorDist(h,a);
self thread rdidest(a,b,c,d,e,f,g,h);
for(;;)
{
a rotatepitch( 90, 2);
wait 2;
a rotatepitch( -90, 2);
wait 2;
}
}
rdidest(a,b,c,d,e,f,g,h)
{
level endon("game_ended");
self waittill("rdi");
a delete();
b delete();
c delete();
d delete();
e delete();
f delete();
g delete();
h delete();
}
monitorDist(axel,bottom)
{
self endon("rdi");
level endon("game_ended");
for(;;)
{
foreach(player in level.players)
{
d=distance(bottom.origin,player.origin);
if(d<100)
{
if(player useButtonPressed())
{
player playerLinkTo(axel);
player.onToy = 1;
}
}
if(d>100 && player.onToy)
{
if(player meleeButtonPressed())
{
player unlink();
player.onToy = 0;
}
}
}
wait 0.05;
}
}
Last edited: