12.06.2014, 15:14
Hello.
I'm trying to make invincible anti cheat, looks like that:
I'm trying to call CheakGM by SetTimerEx, but it's not calling.
What is my problem?
Sorry for my Elnglish. ;(
I'm trying to make invincible anti cheat, looks like that:
pawn Код:
#include <a_samp>
public OnFilterScriptInit()
{
SetTimer("AntiCheat", 60000, true);
return true;
}
forward AntiCheat();
public AntiCheat()
{
for(new i; i < 1000; i++)
{
//if(!IsPlayerConnected(i) || CallRemoteFunction("NoGm", "i", "i")) continue;
new Float:FirstHp;
GetPlayerHealth(i, FirstHp);
SetPlayerHealth(i, FirstHp-1);
SetTimerEx("CheakGM", 2000, false, "if", "i", "FirstHp");
}
}
forward CheakGM(playerid, Float:FirstHp);
public CheakGM(playerid, Float:FirstHp)
{
new Float:SecondHp;
GetPlayerHealth(playerid, SecondHp);
if(floatcmp(FirstHp, SecondHp) == 0) Kick(playerid);
else SetPlayerHealth(playerid, FirstHp);
}
What is my problem?
Sorry for my Elnglish. ;(