Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Timer,pPaused[MAX_PLAYERS];
- forward public AFKTimer(playerid);
- public OnPlayerConnect(playerid)
- {
- pPaused[playerid] = 1;
- Timer = SetTimerEx("AFKTimer",500,1,"i",playerid);
- return 1;
- }
- public AFKTimer(playerid)
- {
- if(pPaused[playerid] != 0)
- {
- printf("%d is paused.",playerid);
- }
- pPaused[playerid] = 1;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- pPaused[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- KillTimer(Timer);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment