hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN_HELP) { if(response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pAdmin] >= 1) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Moderator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 1: { if(PlayerInfo[playerid][pAdmin] >= 2) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Game Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 2: { if(PlayerInfo[playerid][pAdmin] >= 3) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Lead Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 3: { if(PlayerInfo[playerid][pAdmin] >= 4) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Manager", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } } } } return 1; }
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ADMIN_HELP)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Moderator", "/help\n/Milk\n/Baked\n/bread", "Cancel", "");
}
else
return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!");
}
case 1:
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Game Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", "");
}
else
return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!");
}
case 2:
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Lead Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", "");
}
else
return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!");
}
case 3:
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Manager", "/help\n/Milk\n/Baked\n/bread", "Cancel", "");
}
else
return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!");
}
}
}
else
return ShowPlayerDialog(/*Insert the whole syntax, keep the same define "DIALOG_ADMIN_HELP"*/);
}
return 1;
}
if(!response)
return ShowPlayerDialog(...) (on phone) EDIT: pawn Code:
|
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN_HELP) { if(response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pAdmin] >= 1) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Moderator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 1: { if(PlayerInfo[playerid][pAdmin] >= 2) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Game Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 2: { if(PlayerInfo[playerid][pAdmin] >= 3) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Lead Administrator", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } case 3: { if(PlayerInfo[playerid][pAdmin] >= 4) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Manager", "/help\n/Milk\n/Baked\n/bread", "Cancel", ""); } else return SendClientMessage(playerid, COLOR_RED, "You are not authorized to access this section!"); } } } else return ShowPlayerDialog(playerid, DIALOG_ADMIN_HELP, DIALOG_STYLE_LIST, "Commands","Server Moderator\nGame Administrator\nLead Administrator\nServer Manager","Select","Close"); } return 1; }
if(!response) return ShowPlayerDialog(playerid, DIALOG_ADMIN_HELP, DIALOG_STYLE_LIST, "Commands","Server Moderator\nGame Administrator\nLead Administrator\nServer Manager","Select","Close");
if(response)
pawn Code:
pawn Code:
|
Not specially, it's a boolean, the order doesn't matter, if he click ESC it'll set response to false and won't run the true case.
|
hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_ADMIN_HELP) { if(response) { new flag = true; switch(listitem) { case 0: { if(PlayerInfo[playerid][pAdmin] >= 1) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Moderator", "{0085d6}Server Moderator Help:\n{eaeaea}The following commands are for Server Moderators:\n\n/aduty - Goes on admin duty\n/adminmoney - Give yourself money", "Cancel", ""); } else flag = false; } case 1: { if(PlayerInfo[playerid][pAdmin] >= 2) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Game Administrator", "{0085d6}Game Administrator Help:\n{eaeaea}The following commands are for Game Administrators:\n\n/aduty - Goes on admin duty", "Cancel", ""); } else flag = false; } case 2: { if(PlayerInfo[playerid][pAdmin] >= 3) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Lead Administrator", "{0085d6}Lead Administrator Help:\n{eaeaea}The following commands are for Lead Administrators:\n\n/aduty - Goes on admin duty", "Cancel", ""); } else flag = false; } case 3: { if(PlayerInfo[playerid][pAdmin] >= 4) { ShowPlayerDialog(playerid, DIALOG_ADMIN_MENU, DIALOG_STYLE_MSGBOX, "Server Manager", "{0085d6}Server Manager Help:\n{eaeaea}The following commands are for Server Managers:\n\n/aduty - Goes on admin duty\n/makeadmin - Makes a player an admin [LEVEL 1-4]", "Cancel", ""); } else flag = false; } } if(!flag){ SendClientMessage(playerid, COLOR_RED, "ERROR: Not high enough rank to access this section!"); ShowPlayerDialog(playerid, DIALOG_ADMIN_HELP, DIALOG_STYLE_LIST,"Commands","Server Moderator\nGame Administrator\nLead Administrator\nServer Manager","Select","Close"); } } } return 0; }