18.12.2012, 15:34
pawn Код:
new Float:AntiCheater_Vida[MAX_PLAYERS];
forward CheaterHealth();
public CheaterHealth()
{
for(new Var = 0; Var < sizeof(AntiCheater_Vida); Var++)
AntiCheater_Vida[Var] = 0.0;
//foreach(new i: Player)
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerHealth(i, AntiCheater_Vida[i]);
SetPlayerHealth(i, AntiCheater_Vida[i] + 5);
}
SetTimer("CheaterHealthCheck", 5000, false);
return 1;
}
forward CheaterHealthCheck();
public CheaterHealthCheck()
{
new Float:AntiCheaterCheck;
//foreach(new i: Player)
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerHealth(i, AntiCheaterCheck);
printf("ID %d: %0.f = %0.f?", i, AntiCheaterCheck, AntiCheater_Vida[i]);
if(AntiCheaterCheck == AntiCheater_Vida[i])
{
SendClientMessage(i, -1, "Cheater");
}
SetPlayerHealth(i, AntiCheater_Vida[i]);
}
return 1;
}