anticamp()
{
player = self;
seconds = 300;
while(1)
{
wait 1;
if(!isDefined(campspot))
campspot = player.origin;
if(distance(player, campspot) > 300)
{
campspot = player.origin;
seconds = 300;
}
else if(player.sessionstate == "playing")
{
seconds--;
if(isDefined(player.camphud))
player.camphud destroy();
player.camphud = newClientHudElem(player);
player.camphud.x = 555;
player.camphud.y = 400;
player.camphud.alignX = "right";
player.camphud.alignY = "middle";
player.camphud.alpha = 1;
player.camphud.fontScale = 1.5;
player.camphud setValue(seconds);
if(seconds == 50)
player iprintlnbold("Stop camping, start moving!");
if(seconds == 0)
{
player iprintlnbold("You have been camping for too long!, your ammo has been taken.");
player setweaponslotammo("primary",0);
player setweaponslotammo("primaryb",0);
player setweaponslotclipammo("primary", 0);
player setweaponslotclipammo("primaryb", 0);
player takeweapon(player getweaponslotweapon("primaryb"));
seconds = 300;
}
}
}
}