Quote:
Originally Posted by Kar
pawn Код:
PlayerUpdate[MAX_PLAYERS char], // less than 255 players, change it yourself if needed.. Paused[MAX_PLAYERS];
forward OnPlayerPause(playerid); forward OnPlayerUnPause(playerid); forward IsPlayerPaused(playerid);
//1 second timer
if(PlayerUpdate{i} < 2) { PlayerUpdate{i}++; } else { if(Paused[i] != 1) { CallRemoteFunction("OnPlayerPause", "i", i); Paused[i] = 1; } }
public OnPlayerUpdate(playerid) { if(PlayerUpdate{playerid} >= 2) { Paused[playerid] = 0; CallRemoteFunction("OnPlayerUnPause", "i", playerid); } PlayerUpdate{playerid} = 0; return 1; }
public OnPlayerPause(playerid) { printf("[System] - %s(%d) Has Paused", Playername(playerid), playerid); return 1; }
public OnPlayerUnPause(playerid) { printf("[System] - %s(%d) Has Unpaused", Playername(playerid), playerid); return 1; }
|
Why don't you go around all SA-MP forums and copy paste all the codes of "OnPlayerPause" detections too?
They all work!