Make Menu the commands
#1

Ok so I have admin commands and when I type /adminhelp it shows me the commands in the chat, but I want it to be like menu, have sections like "General" , "Shopping", "Bank" and so on, can anyone help me with that, please? :/

I'll REP+
Reply
#2

Use ShowPlayerDialog for showing him a dialog,make it style MSGBOX,and options are Done,thats all
Reply
#3

Can you add an example code? So I could understand better, please :P
Reply
#4

Im from mobile ..
So i cannot help alot because i cannot type code correctly

Anyhow . The code will be like this
pawn Код:
cmd:adminhelp(playerid,params[])
{
Showplayerdialogbox(playerid,222,dialog_type_msg,"admin help","general cmds\nhouses cmds","select","cancel");
}
Reply
#5

pawn Код:
enum
{
    DIALOG_ADMIN    
}
#define DIALOG_ADMIN 966 // used 996 to avoid having another dialog with same id in your script

ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_MSGBOX, "Admin Commands", "General Admin: /kick, /ban", "Close", ""); // like that
If you want to make like Fred's dialog it should be list not MSGBOX,just use mine
Reply
#6

Yea, and I want to add the commands when pressing for example "General" to open another dialog showing all the general commands
Reply
#7

Then make like
pawn Код:
#define DIALOG_ADMIN 996
#define DIALOG_ADMIN1 997


// Under command
ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_LIST, "Admin Commands", "General Commands\nJunior Commands", "Yes", "No");
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_ADMIN)
    {
        if(response)
        {
             ShowPlayerDialog(playerid, DIALOG_ADMIN1, DIALOG_STYLE_MSGBOX, "Admin Commands", "General Admin: /kick, /ban", "Close", ""); // like that
        }
        else
        {
            SendClientMessage(playerid, -1, "You canceled .");
        }
        return 1;
    }
 
    return 0;
}
Reply
#8

Do I need to add this? if (PlayerInfo[playerid][pAdmin] >= 1337)
On what level can the admin view the commands
Reply
#9

Modified R0's post and added what you wanted
Quote:
Originally Posted by R0
Посмотреть сообщение
Then make like
pawn Код:
#define DIALOG_ADMIN 996
#define DIALOG_ADMIN1 997


// Under command
ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_LIST, "Admin Commands", "General Commands\nJunior Commands", "Yes", "No");
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_ADMIN)
    {
        if(response)
        {
             if((PlayerInfo[playerid][pAdmin] >= 1)
             {
                 ShowPlayerDialog(playerid, DIALOG_ADMIN1, DIALOG_STYLE_MSGBOX, "Admin Commands", "General Admin: /kick, /ban", "Close", ""); // like that
             }
             else return SendClientMessage(playerid,randomcolor,"You are not an admin");      
        }
        else
        {
            SendClientMessage(playerid, -1, "You canceled .");
        }
        return 1;
    }
 
    return 0;
}
Reply
#10

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
Modified R0's post and added what you wanted
Thank you bros
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)