Small problem with SetTimerEx
#1

Hello.
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);
}
I'm trying to call CheakGM by SetTimerEx, but it's not calling.
What is my problem?

Sorry for my Elnglish. ;(
Reply
#2

SetTimerEx("CheakGM", 2000, false, "if", i, FirstHp-1);
Reply
#3

pawn Код:
SetTimerEx("CheakGM", 2000, false, "f", "FirstHp");
has to be defined as a float
Reply
#4

Thanks. =)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)