/admins
#1

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
Reply
#2

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
Reply
#3

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;
    }
Reply
#4

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.
Reply
#5

Ooo, then why dont you help him ?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)