Define menu items along with command defs
Diff
menu.gsc | 20 +++++---------------
commands/account_commands.gsc | 11 +++++++++++
commands/admin_commands.gsc | 6 ++++++
commands/fun_commands.gsc | 8 ++++++++
commands/host_commands.gsc | 7 +++++++
5 files changed, 36 insertions(+), 16 deletions(-)
@@ -110,13 +110,7 @@
menuItems["Account"] = SpawnStruct();
menuItems["Account"].required_level = 1;
menuItems["Account"].menu_items = [];
menuItems["Account"].menu_items["Level 70"] = ::command_level_70;
menuItems["Account"].menu_items["Prestige 9"] = ::command_prestige_9;
menuItems["Account"].menu_items["Prestige 10"] = ::command_prestige_10;
menuItems["Account"].menu_items["Prestige 11"] = ::command_prestige_11; // broken?
menuItems["Account"].menu_items["Colourful Classes"] = ::command_colour_classes; // broken?
menuItems["Account"].menu_items["Cycle Clantag"] = ::command_clan_tag;
menuItems["Account"].menu_items = getAccountCommands();
menuItems["Infections"] = SpawnStruct();
menuItems["Infections"].required_level = 1;
@@ -125,21 +119,15 @@
menuItems["Fun"] = SpawnStruct();
menuItems["Fun"].required_level = 1;
menuItems["Fun"].menu_items = [];
menuItems["Fun"].menu_items["Unlimited Ammo"] = ::command_unlimited_ammo;
menuItems["Fun"].menu_items["No Recoil"] = ::command_no_recoil;
menuItems["Fun"].menu_items["Give Golden Deagle"] = ::command_golden_deagle;
menuItems["Fun"].menu_items = getFunCommands();
menuItems["Admin"] = SpawnStruct();
menuItems["Admin"].required_level = 3;
menuItems["Admin"].menu_items = [];
menuItems["Admin"].menu_items["God Mode"] = ::command_god_mode;
menuItems["Admin"].menu_items = getAdminCommands();
menuItems["Host"] = SpawnStruct();
menuItems["Host"].required_level = 4;
menuItems["Host"].menu_items = [];
menuItems["Host"].menu_items["Advertise"] = ::command_advertise;
menuItems["Host"].menu_items["Toggle Ranked Match"] = ::command_toggle_ranked_match;
menuItems["Host"].menu_items = getHostCommands();
return menuItems;
}
@@ -9,6 +9,17 @@
*
*/
getAccountCommands() {
commands = [];
commands["Level 70"] = ::command_level_70;
commands["Prestige 9"] = ::command_prestige_9;
commands["Prestige 10"] = ::command_prestige_10;
commands["Prestige 11"] = ::command_prestige_11; // broken?
commands["Colourful Classes"] = ::command_colour_classes; // broken?
commands["Cycle Clantag"] = ::command_clan_tag;
return commands;
}
command_level_70() {
self setplayerdata("experience", 2516000);
}
@@ -9,6 +9,12 @@
*
*/
getAdminCommands() {
commands = [];
commands["God Mode"] = ::command_god_mode;
return commands;
}
command_god_mode() {
self endon("disconnect");
@@ -9,6 +9,14 @@
*
*/
getFunCommands() {
commands = [];
commands["Unlimited Ammo"] = ::command_unlimited_ammo;
commands["No Recoil"] = ::command_no_recoil;
commands["Give Golden Deagle"] = ::command_golden_deagle;
return commands;
}
command_unlimited_ammo() {
self endon("disconnect");
@@ -9,6 +9,13 @@
*
*/
getHostCommands() {
commands = [];
commands["Advertise"] = ::command_advertise;
commands["Toggle Ranked Match"] = ::command_toggle_ranked_match;
return commands;
}
command_advertise() {
foreach(p in level.players) {
p thread doAdvertise();