SA-MP Forums Archive
help DIALOG_STYLE_LIST Inside LIST - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help DIALOG_STYLE_LIST Inside LIST (/showthread.php?tid=189404)



help DIALOG_STYLE_LIST Inside LIST - 435076378 - 11.11.2010

new i, weaponid, ammo;

new string[212];
new gunname[200];
for (i=0; i<13; i++)
{
GetPlayerWeaponData(playerid,i,weaponid,ammo);
GetWeaponNameEx(i, gunname, sizeof(gunname));
format(string, sizeof string,"%s\n", gunname);
}
ShowPlayerDialog(playerid, wdcd1, DIALOG_STYLE_LIST,"my weapons",string, "ok", "Cancel");




Or




new playername[MAX_PLAYER_NAME];
new string[128];
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
format(string, sizeof string,"\n%d %s\n",i,playername);
}
}
ShowPlayerDialog(playerid, wdcd1, DIALOG_STYLE_LIST,"PlayersLIST",string, "ok", "Cancel");







Can only display a,
How can I show all?


Re: help DIALOG_STYLE_LIST Inside LIST - Jeffry - 11.11.2010

Try this:

First one:
pawn Код:
new string[512];
new gunname[200];
for (i=0; i<13; i++)
{
    GetPlayerWeaponData(playerid,i,weaponid,ammo);
    GetWeaponNameEx(i, gunname, sizeof(gunname));
    format(string, sizeof string,"%s%s\n", string,gunname);
}
ShowPlayerDialog(playerid, wdcd1, DIALOG_STYLE_LIST,"my weapons",string, "ok", "Cancel");
Second one:
pawn Код:
new playername[MAX_PLAYER_NAME];
new string[2048];
for(new i=0;i<MAX_PLAYERS;i++)
{
    if(IsPlayerConnected(i))
    {
        GetPlayerName(i, playername, MAX_PLAYER_NAME);
        format(string, sizeof string,"%s%d.) %s\n",string,i,playername);
    }
}
ShowPlayerDialog(playerid, wdcd1, DIALOG_STYLE_LIST,"PlayersLIST",string, "ok", "Cancel");
Hope it works.
Greetz.


Re: help DIALOG_STYLE_LIST Inside LIST - 435076378 - 11.11.2010

Thank you success


Re: help DIALOG_STYLE_LIST Inside LIST - Jeffry - 11.11.2010

Quote:
Originally Posted by 435076378
Посмотреть сообщение
Thank you success
Nice. Thanks for the feedback.
Have fun.


Re: help DIALOG_STYLE_LIST Inside LIST - TheXIII - 11.11.2010

Holy mother of strings.