Anti-Cheat Bug?
#6

pawn Код:
new pSpawned[MAX_PLAYERS];//creating a variable to use for when a player is spawned
forward hackcheck();

public OnPlayerConnect(playerid)
{
     pSpawned[playerid] = 0;//setting it to 0 so the server knows you are not spawned.
     return 1;
}
public OnPlayerSpawn(playerid)
{
    pSpawned[playerid] ++;//Setting it to 1 so the server knows you are spawned
}
 
public OnGameModeInit()
{
     SetTimer("hackcheck", 1000, true);// setting a repeating timer
     return 1;
}
public hackcheck()// our timers call back
{
    for(new i; i < MAX_PLAYERS; i++;// looping through each player
    {
        if(gSpawned[i]  >= 1)// checks if the player is spawned
        {
            AntiHack(i);
        }
    }
   return 1;
}
Completly untested wrote in the browser, this should get you on the right track however I suggest just sending admins warnings, and also saving the warings to a log so you can check and see if hackers are around when no admins are present. These systems can always be bugged and a shamal will caused people to get banned for speed hacks using your code.
Reply


Messages In This Thread
Anti-Cheat Bug? - by Ashley - 13.03.2012, 17:20
Re: Anti-Cheat Bug? - by T0pAz - 13.03.2012, 17:24
Re: Anti-Cheat Bug? - by coole210 - 13.03.2012, 17:25
Re: Anti-Cheat Bug? - by Ashley - 13.03.2012, 17:32
Re: Anti-Cheat Bug? - by Ashley - 14.03.2012, 02:31
Re: Anti-Cheat Bug? - by new121 - 14.03.2012, 05:08

Forum Jump:


Users browsing this thread: 1 Guest(s)