Wanted list
#2

that's because you're getting the players name and then showing it in a dialog instead of getting all the names and putting them in a string and then putting that into a dialog

pawn Код:
COMMAND:wanted(playerid, params[])
{
    new count, namestr[MAX_PLAYER_NAME], string[128];//64 is too much since the max length of a name is like ~20
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerWantedLevel(i)!=0)
            {
                count++;
                GetPlayerName(i,namestr,MAX_PLAYER_NAME);
                if(!strlen(string))
                {
                    format(string,sizeof(string),"%s level: %d",namestr,GetPlayerWantedLevel(i));
                }
                else
                {
                    format(string,sizeof(string),"\n%s level: %d",namestr,GetPlayerWantedLevel(i));    
                }
            }
        }
    }
//also you'd use ShowPlayerDialog outside of the loop, just after it's finished
    ShowPlayerDialog(playerid,500, DIALOG_STYLE_MSGBOX, "Wanted List.",string,"Ok", "Cancel");
    if(count == 0)return SendClientMessage(playerid,White,"There are no wanted Players");
    return 1;
}
Reply


Messages In This Thread
Wanted list - by zack3021 - 23.11.2010, 21:45
Re: Wanted list - by cessil - 23.11.2010, 22:43
Re: Wanted list - by zack3021 - 24.11.2010, 00:01

Forum Jump:


Users browsing this thread: 1 Guest(s)