Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new pAfk[MAX_PLAYERS];
- new pAfkS[MAX_PLAYERS];
- public OnPlayerUpdate(playerid)
- {
- if(pAfk[playerid] == 1 && pAfks < 0)
- {
- new string[144];
- format(string, sizeof(string), "%s è tornato dall'afk!", GetName(playerid));
- SendClientMessageToAll(0xFFFFFFFF, string);
- }
- pAfk[playerid] = 0;
- pAfk[playerid] = 0;
- return 1;
- }
- AddAfk()
- {
- new string[144];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
- pAfk[i] = 1;
- pAfkS[playerid]++;
- if(GetPVarInt(playerid, "AFKMinutes") > 2)
- {
- format(string, sizeof(string), "%s è andato afk!", GetName(playerid));
- SendClientMessageToAll(0xFFFFFFFF, string);
- pAfkS[playerid] = -2000000;
- }
- }
- return 1;
- }
- public OnGameModeInit()
- {
- SetTimer("AddAfk", 1000, true);
- return 1;
- }
- GetName(playerid)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- return pName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement