ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
So, you could:
pawn Код:
// in OnPlayerCommandText (if you're using that??)
if(strcmp("/commands", cmdtext, true, 8) == 0)
{
// using 1 for dialogid might cause conflict, change it to the next available id.
ShowPlayerDialog(playerid, /* dialogid */ 1, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
return 1;
}
// if using ZCMD
CMD:commands(playerid, params[])
{
// using 1 for dialogid might cause conflict, change it to the next available id.
ShowPlayerDialog(playerid, /* dialogid */ 1, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
return 1;
}
// In OnDialogResponse
if(dialogid == 1 /* or the dialogid you selected */)
{
if(response) {
switch(listitem) {
case 0: {
SendClientMessage(playerid, -1, "*Commands* Some commands here");
}
case 1: {
if(IsPlayerAdmin(playerid)) {
SendClientMessage(playerid, -1, "*Admin Commands* some commands here");
}
}
}
}
}