Make Menu the commands -
VladimirMark - 27.05.2014
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+
Re: Make Menu the commands -
R0 - 27.05.2014
Use ShowPlayerDialog for showing him a dialog,make it style MSGBOX,and options are Done,thats all
Re: Make Menu the commands -
VladimirMark - 27.05.2014
Can you add an example code? So I could understand better, please :P
Re: Make Menu the commands -
Fred1993 - 27.05.2014
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");
}
Re: Make Menu the commands -
R0 - 27.05.2014
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
Re: Make Menu the commands -
VladimirMark - 27.05.2014
Yea, and I want to add the commands when pressing for example "General" to open another dialog showing all the general commands
Re: Make Menu the commands -
R0 - 27.05.2014
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;
}
Re: Make Menu the commands -
VladimirMark - 27.05.2014
Do I need to add this? if (PlayerInfo[playerid][pAdmin] >= 1337)
On what level can the admin view the commands
Re: Make Menu the commands -
DavidBilla - 27.05.2014
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; }
|
Re: Make Menu the commands -
VladimirMark - 27.05.2014
Quote:
Originally Posted by DavidBilla
Modified R0's post and added what you wanted
|
Thank you bros