SA-MP Forums Archive
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(playeridparams[])
{
    new 
IsOnline 0string[128];
    foreach(
Playeri)
    {
        if(
PlayerInfo[i][pAdmin] > && IsPlayerConnected(i))
         {
            switch(
PlayerInfo[i][pAdmin])
            {
                case 
2LevelName ADMIN_LEVEL_2;
                case 
3LevelName ADMIN_LEVEL_3;
                case 
4LevelName ADMIN_LEVEL_4;
                case 
5LevelName ADMIN_LEVEL_5;
            }
            
format(stringsizeof(string), "%s {FF2400}(%d) %s\n"PlayerName(i), iLevelName);
            
IsOnline++;
            
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_LIST"Online Administrators team"string"Close""");
            if(
IsOnline == 0)
            {
                 
ShowPlayerDialog(playeridDIALOG_NO_ADMINSDIALOG_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));
}