Dialog - 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)
+--- Thread: Dialog (
/showthread.php?tid=559426)
Dialog -
nezo2001 - 23.01.2015
I have this code to show all oline admins
PHP код:
CMD:admins(playerid, params[])
{
new IsOnline = 0, string[128];
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 1 && IsPlayerConnected(i))
{
switch(PlayerInfo[i][pAdmin])
{
case 2: LevelName = ADMIN_LEVEL_2;
case 3: LevelName = ADMIN_LEVEL_3;
case 4: LevelName = ADMIN_LEVEL_4;
case 5: LevelName = ADMIN_LEVEL_5;
}
format(string, sizeof(string), "%s {FF2400}(%d) %s\n", PlayerName(i), i, LevelName);
IsOnline++;
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Online Administrators team", string, "Close", "");
if(IsOnline == 0)
{
ShowPlayerDialog(playerid, DIALOG_NO_ADMINS, DIALOG_STYLE_MSGBOX, "Online Administrators team", "There are no administrators currently online!", "Close", "");
}
}
}
return 1;
}
It show the dialog but it only show one admin while there are three online it show one of them.
Please Help !
Re: Dialog -
Ironboy - 23.01.2015
pawn Код:
format(string, sizeof(string), "%s %s {FF2400}(%d) %s\n", string, PlayerName(i), i, LevelName);
Re: Dialog -
JakeHunter1 - 23.01.2015
pawn Код:
if(PlayerInfo[i][pAdmin])
{
format(string, sizeof(string), " %s %s ", RPALN(i), RPN(i));
Try it like this , this is from my server just edit it ..
Re: Dialog -
danish007 - 23.01.2015
pawn Код:
if(PlayerInfo[i][pAdmin] > 0)
{
format(string, sizeof(string),"%s{FFFFFF} Name:{0087FF} %s{FFFFFF}\n", string,PlayerName(i));
}