Advertisement
agrippa1994

SAMP AFK

Jul 1st, 2012
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.51 KB | None | 0 0
  1. enum pInfo
  2. {
  3.     pAFK
  4. };
  5. new PlayerInfo[MAX_PLAYERS][pInfo];
  6.  
  7. forward AFKCheck();
  8.  
  9. public OnGameModeInit()
  10. {
  11.     SetTimer(AFKCheck,1000,1);
  12.     return 1;
  13. }
  14. public OnPlayerUpdate(playerid)
  15. {
  16.     PlayerInfo[playerid][pAFK]=0;
  17.     return 1;
  18. }
  19. public AFKCheck()
  20. {
  21.     for(new i=0;iMAX_PLAYERS;i++)
  22.     {
  23.         if(!IsPlayerConnected(i)) continue;
  24.         PlayerInfo[i][pAFK]++;
  25.         if(PlayerInfo[i][pAFK]>5)
  26.             OnPlayerAFK(i);
  27.     }
  28. }
  29. stock OnPlayerAFK(playerid)
  30. {
  31.     SendClientMessage(playerid,0xFFFFFFFF,"Du bist AFK!");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement