🏡 index : ~doyle/cool-beans.gsc.git

author Jordan Doyle <jordan@doyle.la> 2021-07-15 21:27:26.0 +01:00:00
committer Jordan Doyle <jordan@doyle.la> 2021-07-15 21:27:26.0 +01:00:00
commit
452cfc100f9440428fceb06ba8023b34d9e65ef2 [patch]
tree
f704b3a23dae2fdbd2194d00c2ae45fd23f7caa3
parent
7c1baf540f2e97e6fc7d763c47a0925cf535c6fd
download
main.tar.gz

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(-)

diff --git a/menu.gsc b/menu.gsc
index 7dc69d4..503592b 100644
--- a/menu.gsc
+++ a/menu.gsc
@@ -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;
}
diff --git a/commands/account_commands.gsc b/commands/account_commands.gsc
index e263c78..817d8ed 100644
--- a/commands/account_commands.gsc
+++ a/commands/account_commands.gsc
@@ -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);
}
diff --git a/commands/admin_commands.gsc b/commands/admin_commands.gsc
index 6853518..616d464 100644
--- a/commands/admin_commands.gsc
+++ a/commands/admin_commands.gsc
@@ -9,6 +9,12 @@
*
*/

getAdminCommands() {
    commands = [];
    commands["God Mode"] = ::command_god_mode;
    return commands;
}

command_god_mode() {
    self endon("disconnect");
    
diff --git a/commands/fun_commands.gsc b/commands/fun_commands.gsc
index 632191e..7357446 100644
--- a/commands/fun_commands.gsc
+++ a/commands/fun_commands.gsc
@@ -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");

diff --git a/commands/host_commands.gsc b/commands/host_commands.gsc
index 14798c2..32f3fa8 100644
--- a/commands/host_commands.gsc
+++ a/commands/host_commands.gsc
@@ -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();