22.10.2011, 11:49
Hey im making afklist but i have some problems...player id 0 can see everyone which is AFK..others can see only one player that is afk
PHP код:
CMD:afklist(playerid,params[])
{
new count = 0,
string[128],
pName[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerIsAFK[i] == 1)
{
GetPlayerName(i, pName,sizeof(pName));
format(string, sizeof(string), "Player: {99EE22}%s, {992233}ID: {99DDDD}%d", pName, i);
ShowPlayerDialog(playerid,837,DIALOG_STYLE_LIST,"AFK PLAYERS:",string,"OK","Cancel");
count++;
}
}
}
if (count == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "No one AFK!");
}
return 1;
}