From ce7cb2fcb0c93b9ad44d083197739484c37974b0 Mon Sep 17 00:00:00 2001 From: Finny Merrill Date: Fri, 12 Dec 2003 03:51:57 +0000 Subject: [PATCH] Whoops --- cmds.qc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 cmds.qc diff --git a/cmds.qc b/cmds.qc new file mode 100644 index 0000000..e4ad091 --- /dev/null +++ b/cmds.qc @@ -0,0 +1,45 @@ +#include "defs.qh" + +#ifdef NO_USER_CMDS + +void() AddCommands = { }; +void(entity client) AddCommandAliases = { }; + +#else + +integer commands_added; + +void() Cmd_Weapon_f; + +void() AddCommands = +{ + if (!commands_added) + { + SV_AddUserCommand ("weapon", Cmd_Weapon_f, TRUE); + } + + commands_added = TRUE; + return; +}; + +void(entity client) AddCommandAliases = +{ + if (self.got_aliases_num == 4) + { + stuffcmd (client, "alias reload \"cmd weapon reload\"\n"); + } +}; + +void() Cmd_Weapon_f = +{ + if (Cmd_Argc() < 2) + { + // do something here + } + else if (Cmd_Argv(1) == "reload") + { + TeamFortress_ReloadCurrentWeapon(); + } +}; + +#endif