" ALL " as dialog list
#1

I think I thought I saw on a server, once, were gang players are dialog items, that you could click on the dialog item and were shown his info. I can do that for show all players on a dialog list:
pawn Код:
dcmd_allip(playerid, params[])
{
    new string[300];
    foreach(Player, i)
    {
        format(string,sizeof(string),""#red" %s (id: %d) | "#green"Ip: %s\n",GetMyName(i),i,GetMyIp(i));
    }
    return ShowPlayerDialog(playerid,IP_DIALOG,DIALOG_STYLE_LIST,""#red"IP "#green"List",string,"Ok","");
}

But how can I make the item list as a dialog option and show anything about player, as example?
pawn Код:
if(dialogid == IP_DIALOG)
{
     switch(listitem) { case 0: ... }:
}
Or even make all names from a array into dialog, as listitem.
Reply
#2

Use the online list..

"OnPlayerClickedPlayer"
Reply
#3

Example please. Dont know what you mean, but I know that there's this callback as you said.
Reply
#4

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if(source == 0)
    {      
        if(PlayerIsJuniorAdmin(playerid))
        {
                    //formatastring?
            Admin[playerid][aActive] = 1;
            Admin[playerid][aEdit] = clickedplayerid;
            return ShowPlayerDialog(playerid, D_ADMIN, LIST, "Junior Administrator Menu", string, "Select", "Close");
        }
        }
        return true;
}
This is a piece of my Admin system, controlled by OnPlayerClickPlayer
Reply
#5

Bro, but how do I process the listitem from the dialog? cuz it need to be on dialog response callback:
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    foreach(Player, i)
    {
        new string[128];
        format(string,sizeof(string)," %s ",GetMyName(i));
        ShowPlayerDialog(playerid,600,DIALOG_STYLE_MSGBOX,".",string,"ok");
    }
    return 1;
}
Reply
#6

Save it in an Array
Reply
#7

Dude, I mean it need to be numered on the listitem, like that:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
         switch(listitem)
         {
               case 0: ...
               case 1: ....
               case 2: .....
          }
          return 1;
    }
}
and I can't save on a array, since I dont know which ID will be the 0, 1, 2...
Can you show me how did you do? since you told me you did that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)