afk system
#1

what is the afk system that when u /afk take u to lv and change word and put near ur name [AFK]_%s
Reply
#2

add this at the top;

Код:
new playerAFK[MAX_PLAYERS];
new playerAFKTime[MAX_PLAYERS];
this OnPlayerConnect

Код:
playerAFKTime[playerid] = 0; playerAFK[playerid] = 0;
and then this to the bottom of ur script:

Код:
CMD:afk(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 2) {

		new
		szMessage[36 + MAX_PLAYER_NAME];

		SendClientMessageEx(playerid,COLOR_WHITE,"Listing all AFK players...");
		foreach(Player, i) if(playerAFK[i] != 0 && playerAFKTime[i] > 60) {
			format(szMessage,sizeof(szMessage),"* %s (ID %d), AFK for %d minutes.", GetPlayerNameEx(i), i, playerAFKTime[i] / 60);
			if(PlayerInfo[i][pAdmin] >= 2) SendClientMessageEx(playerid,COLOR_RED,szMessage);
			else SendClientMessageEx(playerid,COLOR_GREY,szMessage);
		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)