Hey, can i have a little help
#1

Well hello, i was woundering if you guys could send me a link or even show me a code or something of how to make a /admins dialog, so i shows all the online admins, and if no admins are online then it says in the dialog "No admins online"
If you could help me i would really appreciate it
Reply
#2

try

pawn Код:
//At top of script
#include <zcmd>

CMD:admins(playerid, params[])
{
    #pragma unused params
    new count=0;
    new string[128],sendername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(pInfo[i][level] > 0) // change to your admin system
                {
                    GetPlayerName(i , sendername, sizeof(sendername));
                    format(string, sizeof(string),"Level %d: %s",pInfo[i][level], sendername);
                    ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Online Administrators:",string,"Ok","");
                    count++;
                }
            }
        }
        if (count == 0)
        SendClientMessage(playerid,COLOR_GREY,"There are no Admins Online at the moment");
    }
    return 1;
}
Reply
#3

That code works, but when there are no admins online it shows the name of the person who typed the command, anyway to fix that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)