SA-MP Forums Archive
/admins - 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: /admins (/showthread.php?tid=500991)



/admins - Mriss - 15.03.2014

I need help making a /admins command in ZCMD


CMD:admins(playerid,params[])




My Admin thing is

pawn Код:
if(pInfo[playerid][pAdmin] < 1)
And it goes to level 1 admin - level 6 admins


Re: /admins - cessil - 16.03.2014

loop through the players and if their admin variable is greater than 0 then format a string and display to the player

I assume that is what you want /admins to do


Re: /admins - ChandraLouis - 16.03.2014

pawn Код:
CMD:admins(playerid,params[])
    {
            new str[256],Name[MAX_PLAYER_NAME];
            foreach(new i:Player)
            {
                if(IsPlayerAdmin(i)||PlayerInfo[i][pAdmin]>0)
                {
                            GetPlayerName(i,Name,sizeof(Name));
                            format(str,sizeof(str),"Name : %s | Level : %i",Name, pInfo[playerid][pAdmin]);
                            ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "{FF0000}Evolution Administrators", str, "OK", "Close")
                }
            }
            return 1;
    }



Re: /admins - CuervO - 16.03.2014

Quote:
Originally Posted by ChandraLouis
Посмотреть сообщение
pawn Код:
CMD:admins(playerid,params[])
    {
            new str[256],Name[MAX_PLAYER_NAME];
            foreach(new i:Player)
            {
                if(IsPlayerAdmin(i)||PlayerInfo[i][pAdmin]>0)
                {
                            GetPlayerName(i,Name,sizeof(Name));
                            format(str,sizeof(str),"Name : %s | Level : %i",Name, pInfo[playerid][pAdmin]);
                            ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "{FF0000}Evolution Administrators", str, "OK", "Close")
                }
            }
            return 1;
    }
I can't seem to figure whether you posted that as a reference or you just failed at copy pasting. Either ways the script will fail because there's no new line in the dialogs, so it will only display the last admin because the ShowPlayerDialog is inside of the loop.


Re: /admins - ChandraLouis - 16.03.2014

Ooo, then why dont you help him ?


Re: /admins - CuervO - 16.03.2014

Quote:
Originally Posted by ChandraLouis
Посмотреть сообщение
Ooo, then why dont you help him ?
Because someone already answered his question

Quote:
Originally Posted by cessil
Посмотреть сообщение
loop through the players and if their admin variable is greater than 0 then format a string and display to the player

I assume that is what you want /admins to do
Plus, I am helping him by telling him not to use malfunctioning code.