14.01.2015, 11:51
OK so now I defined the texts so I only have to edit them once, I now wonder if there's a simpler way to do it or if this is the only way.
pawn Код:
#define CommandsText "Commands", "General Commands\nJob Commands\nPolice Commands\nCriminal Commands\nVIP Commands\n", "", "Close"
#define GeneralCommandsText "{FFFFFF}General Commands", "{FFFFFF}A list of general commands:\n\n{FF8000}/jobs{FFFFFF} Select a job if you failed to choose one on spawn.\n{FF8000}/about{FFFFFF} Display general information and credits.\n{FF8000}/changelog{FFFFFF} Show what's new in this current version.\n{FF8000}/kill{FFFFFF} Kill yourself if stuck.\n{FF8000}/admins{FFFFFF} List of administrators currently online.\n{FF8000}/pm{FFFFFF} Send a private message.\n{FF8000}/ignore{FFFFFF} Ignore annoying players.\n{FF8000}/blockpms{FFFFFF} Block all incoming PMs.\n{FF8000}/locate{FFFFFF} Locate a player.\n{FF8000}/givecash{FFFFFF} Send cash to a player.", "Ok", ""
#define JobCommandsText "{FFFFFF}Job Commands", "{FFFFFF}Commands for your currently selected job: Car Jacker\n\n{FF8000}/sellcar{FFFFFF} Sell your newly stolen car to nearest Car Crane.\n{FF8000}/carvalue{FFFFFF} Display current vehicle's value.\n{FF8000}", "Ok", ""
#define PoliceCommandsText "{FFFFFF}Police Commands", "{FFFFFF}A list of commands available for Police Officers:\n\n{FF8000}/arrest{FFFFFF} Arrests closest criminal within your range.\n{FF8000}/ticket{FFFFFF} Tickets closest criminal within your range.\n{FF8000}/mw {FFFFFF}List of most wanted players and their current location.\n{FF8000}/warrants {FFFFFF}List of wanted players and their current location.\n{FF8000}/respond {FFFFFF}Respond to a emergency call.", "Ok", ""
#define CriminalCommandsText "{FFFFFF}Criminal Commands", "{FFFFFF}A list of commands available for Criminals:\n\n{FF8000}/rob{FFFFFF} Rob closest player within your range\n{FF8000}/rape{FFFFFF} Rape closest player within your range\n{FF8000}/holdup {FFFFFF}Rob a store.{FF8000}\n/bankrob {FFFFFF}Start a Bank Robbery.\n{FF8000}/sellcar {FFFFFF}Sell a stolen vehicle to the car crane.", "Ok", ""
#define VIPCommandsText "{FFFFFF}VIP Commands", "{FFFFFF}A list of exclusive commands avaible to VIP only:\n\n{FF8000}/vc{FFFFFF} VIP Chat\n{FF8000}/vcolor{FFFFFF} Change the color of your current Vehicle.\n{FF8000}/vplate {FFFFFF}Change the text of your vehicle plate.{FF8000}\n/vmods {FFFFFF}Apply free mods to your vehicle", "Ok", ""
Dialog:CommandsDialog(playerid, response, listitem, inputtext[])
{
if (response)
{
switch(listitem)
{
case 0:
{
Dialog_Show(playerid, GeneralCommands, DIALOG_STYLE_MSGBOX, GeneralCommandsText);
}
case 1:
{
Dialog_Show(playerid, JobCommands, DIALOG_STYLE_MSGBOX, JobCommandsText);
}
case 2:
{
Dialog_Show(playerid, PoliceCommands, DIALOG_STYLE_MSGBOX, PoliceCommandsText);
}
case 3:
{
Dialog_Show(playerid, CriminalCommands, DIALOG_STYLE_MSGBOX, CriminalCommandsText);
}
case 4:
{
Dialog_Show(playerid, VIPCommands, DIALOG_STYLE_MSGBOX, VIPCommandsText);
}
}
}
return 1;
}
Dialog:GeneralCommands(playerid, response, listitem, inputtext[])
{
if(response) return Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}
Dialog:JobCommands(playerid, response, listitem, inputtext[])
{
if(response) return Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}
Dialog:PoliceCommands(playerid, response, listitem, inputtext[])
{
if(response) return Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}
Dialog:CriminalCommands(playerid, response, listitem, inputtext[])
{
if(response) return Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}
Dialog:VIPCommands(playerid, response, listitem, inputtext[])
{
if(response) return Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}
/*
*
* Commands
*
*/
CMD:commands(playerid, params[])
{
Dialog_Show(playerid, CommandsDialog, DIALOG_STYLE_LIST, CommandsText);
return 1;
}