AFKLIST
#1

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 
0MAX_PLAYERSi++)
        {
             if (
IsPlayerConnected(i))
             {
                if(
PlayerIsAFK[i] == 1)
                {
                    
GetPlayerName(ipName,sizeof(pName));
                    
format(stringsizeof(string), "Player: {99EE22}%s, {992233}ID: {99DDDD}%d"pNamei);
                    
ShowPlayerDialog(playerid,837,DIALOG_STYLE_LIST,"AFK PLAYERS:",string,"OK","Cancel");
                    
count++;
                }
            }
        }
        if (
count == 0)
        {
            
SendClientMessage(playeridCOLOR_BLUE"No one AFK!");
        }
        return 
1;

Reply
#2

pawn Код:
CMD:afklist(playerid,params[])
{
        new count = 0, string[4096], pName[MAX_PLAYER_NAME];

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (GetPlayerName(i, pName,sizeof(pName)))
        {
            if(PlayerIsAFK[i] == 1)
            {
                format(string, sizeof(string), "%sPlayer: {99EE22}%s, {992233}ID: {99DDDD}%d\n",
                string, pName, i);
                count++;
            }
        }
    }
    if (count == 0)
    {
        SendClientMessage(playerid, COLOR_BLUE, "No one AFK!");

    } else ShowPlayerDialog(playerid,837,DIALOG_STYLE_LIST,"AFK PLAYERS:",string,"OK","Cancel");
    return 1;
}
Reply
#3

THANKS DUDE, i changed string[4096] to 2500...you deserver thousands of reps..GOT A REP XD
Reply
#4

Works fantastic ty man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)