21.11.2015, 15:38
Does your anticheat runs in OnPlayerUpdate? If yes I recommend you to make 3 second global timer and loop players to check for cheats.
or you can use this:
or you can use this:
PHP код:
#define SEND_DELAY_TIME 5000 // Edit this to meet your needs; although it shouldn't be lower than 1000.
new
LastTickCount[MAX_PLAYERS] = {0,...}; // In your script near other variables under defines
OnCheat(playerid, type, code)
{
if(LastTickCount[MAX_PLAYERS] < GetTickCount()) // Checks if 5 seconds are passed
{
LastTickCount[MAX_PLAYERS] = GetTickCount() + SEND_DELAY_TIME; // Sets the LastTick to current Tick.
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, 256, "Server detected %s on %s(%i).", Cheatsa[code], name, playerid);
ABroadCast(-1,string,1);
}
}