18.02.2013, 11:01
Please help me with this :
It's good when I compile that.
But when I tried that in game, it's said "No One is AFK Now!", although my friend was AFK ! I tried the opposite (i was AFK and he tried the cmd) , it's same !
But, when I was AFK and I used that command, it's showing us (me and my friend), although only me afk at that time.
Please help me to fix it and Sorry for my bad English
pawn Код:
CMD:afklist(playerid, params[])
{
new Count = 0;
for(new i = 0; i< MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAFK[playerid] == 1) Count++;
if(Count == 0)
{
SendClientMessage(playerid, COLOR_GRAD2,"ERROR : No One is AFK Now !");
}
format(str, 128, "List AFK - There Are %d AFK Players", Count);
SendClientMessage(playerid, COLOR_WHITE, str);
if(IsPlayerConnected(i) && IsPlayerAFK[playerid] == 1)
{
format(str, 128, "- %s (%d) is AFK", PlayerName(i), i);
SendClientMessage(playerid, COLOR_GREEN, str);
}
}
return 1;
}
But when I tried that in game, it's said "No One is AFK Now!", although my friend was AFK ! I tried the opposite (i was AFK and he tried the cmd) , it's same !
But, when I was AFK and I used that command, it's showing us (me and my friend), although only me afk at that time.
Please help me to fix it and Sorry for my bad English