Code:
antiCamp()
{
self endon("killed_player");
count = 0;
time = 15;
for(;;)
{
origin = self.origin;
wait 1;
if(self.origin == origin)
count++;
else
count = 0;
if(count == time)
self suicide();
}
}
For standalone
Code:
init()
{
thread onPlayerConnect();
}
onPlayerConnect()
{
level endon("intermission");
for(;;)
{
level waittill("connecting", player);
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon("disconnect");
level endon("intermission");
for(;;)
{
self waittill("spawned_player");
self thread antiCamp();
}
}