Script is really very boring, but besides, there are a lot of nuances to consider.
Try something like this
PHP Code:
/* start this (self ...();) when play connected on server */
onPlayerConnect()
{
self checkLoop();
}
checkLoop()
{
self endon("disconnect");
/* cfg */
waitTime = .1; //maybe .25;
//ALL "CAMP_SECS_*" vars must be multiples of "waitTime" (4 / 0.1 & 6 / 0.1 == true => good)
CAMP_RADIUS = 100;
CAMP_SECS_WARN = 4;
CAMP_SECS_PUNISH = 6;
self waittill("spawned"); //check your SpawnPlayer in gametype.gsc, need self notify("spawned") or remove this line
self.previousPosition = self.origin;
self.campTik = 0;
while (1)
{
if (isAlive(self) && (team == "allies" || team == "axis"))
{
if (distance(self.previousPosition, self.origin) > CAMP_RADIUS)
{
self.previousPosition = self.origin;
self.campTik = 0;
}
else
self.campTik++;
campingTime = (self.campTik * waitTime);
if (campingTime == CAMP_SECS_WARN)
self iprintlnBold("stop camp or be kill!");
if (campingTime == CAMP_SECS_PUNISH)
{
self.campTik = 0;
self iprintlnBold("Camper!");
self suicide();
}
}
wait waitTime;
}
}
no tested, maybe some syntax error or dont work