#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
antiAFK()
{
for(;;)
{
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}

My Fail 
antiAFK()
{
for(;;)
{
self endon("disconnect");
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
player thread doBinds();
self thread antiAFK();
player thread onJoinedTeam();
player thread onJoinedSpectators();
self thread doDvars()
}
}
player thread onJoinedTeam(); player thread onJoinedSpectators();

player thread onJoinedTeam();
player thread onJoinedSpectators();
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread doDvars();
self thread antiAFK();
//self thread checkKick(); // Disabled Kick Menu for now
//self thread displayPlayerMenu();
//self thread monitorUp();
//self thread monitorDown();
//self thread monitorLeft();
//self thread monitorB();
//self thread monitorA();
//self thread monitorX();
}
}}
antiAFK()
{
for(;;)
{
self.before = self getorigin();
wait 4;
self.after = self getorigin();
if( ( distance(self.before, self.after) < 50) )
{
self iPrintlnBold("You have been killed for camping");
self.health = int(self.health / 2);
}
if (self.health == 1)
self suicide();
}
}