SetTimer("HealthArmourCheat", 5000, true);
public OnPlayerUpdate(playerid)
{
return 1;
}
This callback is called everytime a client/player updates the server with their status. |
forward HealthArmourCheat(playerid);
forward HealthArmourCheat2(playerid);
SetTimer("HealthArmourCheat", 100, true);
SetTimer("HealthArmourCheat2", 101, true);
public HealthArmourCheat(playerid)
{
GetPlayerArmour(playerid,armour);
return 1;
}
public HealthArmourCheat2(playerid)
{
new Float:newarmour;
if(GetPlayerArmour(playerid,newarmour))
{
if (newarmour < armour)
{
Kick(playerid);
}
return 1;
}
return 1;
}
Emh...i've a unique code for Health and Armour spawn,unique timer,i don't need to separate in 2 timers,2 publics and 2 forwards.I just need to run the timer ONLY when the player HP or Armour is more than 99.
|
forward HealthArmourverification(playerid)
SetTimer("HealthArmourverification", 5000, true);
public HealthArmourverification(playerid)
{
new Float:checkarmour;
if(GetPlayerArmour(playerid,checkarmour))
{
if (checkarmour > 99)
{
//your anticheat timer
}
return 1;
}
else if(GetPlayerHealth(playerid,checkarmour))
{
new Float:checkhealth;
if (checkhealth > 99)
{
//your anticheat timer
}
return 1;
}
return 1;
}