14.03.2012, 05:08
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;
}