Online admins dialog /admins help please.
#1

Hello again , sorry guys for 3 questions , some guys helped me with how to create some commands like
/setadmin , and i already defined admins ranks
Код:
stock GetPlayerAdminRank(playerid)
{
    new rankname[32];

    switch(PlayerInfo[playerid][pAdminLevel])
    {
        case 1: { rankname = "Moderator"; }
        case 2: { rankname = "Senior Admin"; }
        case 3: { rankname = "Head Admin"; }
        case 4: { rankname = "Owner"; }
    }

    return rankname;
}
Now i just wanna create a command to show online administrators in dialog style msgbox like this
Owner : SilentSoul
Thanks.

Sorry guys i know i have to create my own commands , but i just started learning yesterday , already searched on ****** can't find directly what i want or something editable , sorry for my bad english!
Reply
#2

pawn Код:
CMD:admins(playerid, params[])
{
    new count = 1, name[24], string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdminLevel] != 0)
        {
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s%s: %s\n", string, GetPlayerAdminRank(i), name);
            count ++;
        }
    }

    if(count > 0)
    {
        ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
    }
    else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
return 1;
}
Reply
#3

I already got this cmd , when i tried on server doesn't show my name in list so i ask you guys for help
Check back : https://sampforum.blast.hk/showthread.php?tid=460471 Please.
Thanks for reply.
Reply
#4

I am sorry i try it now working thanks , but why it gives me Server Unkown command. While i already see the dialog ?
Reply
#5

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
I already got this cmd , when i tried on server doesn't show my name in list so i ask you guys for help
Check back : https://sampforum.blast.hk/showthread.php?tid=460471 Please.
Thanks for reply.
Probably because you have this:
pawn Код:
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
change it to:
pawn Код:
if(IsPlayerConnected(i) && PlayerInfo[i][pAdminLevel] != 0)
Reply
#6

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
Probably because you have this:
pawn Код:
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
change it to:
pawn Код:
if(IsPlayerConnected(i) && PlayerInfo[i][pAdminLevel] != 0)
Thank you , but please tell me guys why when i type /admins it automatically type in chat Server:Unkown Command , while its working ?
Reply
#7

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
I am sorry i try it now working thanks , but why it gives me Server Unkown command. While i already see the dialog ?
Copy that command in the post up there again. You must have

pawn Код:
return 1;
Else, zcmd will do
pawn Код:
return 0;
which will display
Код:
SERVER: Unknown command
I tell you that so that you might actually learn something from this whole charade...
Reply
#8

Could you post your /admins command?

Edit: Nevermind, read the post above.
Reply
#9

Thank you very much. also thank you Skribblez for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)