Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum pInfo
- {
- pAFK
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward AFKCheck();
- public OnGameModeInit()
- {
- SetTimer(AFKCheck,1000,1);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- PlayerInfo[playerid][pAFK]=0;
- return 1;
- }
- public AFKCheck()
- {
- for(new i=0;iMAX_PLAYERS;i++)
- {
- if(!IsPlayerConnected(i)) continue;
- PlayerInfo[i][pAFK]++;
- if(PlayerInfo[i][pAFK]>5)
- OnPlayerAFK(i);
- }
- }
- stock OnPlayerAFK(playerid)
- {
- SendClientMessage(playerid,0xFFFFFFFF,"Du bist AFK!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement