float regen_mod_limit;
MUTATOR_HOOKABLE(PlayerRegen, EV_PlayerRegen);
+/**
+ * called when the use key is pressed
+ * if MUTATOR_RETURNVALUE is 1, don't do anything
+ * return 1 if the use key actually did something
+ */
MUTATOR_HOOKABLE(PlayerUseKey, EV_NO_ARGS);
- // called when the use key is pressed
- // if MUTATOR_RETURNVALUE is 1, don't do anything
- // return 1 if the use key actually did something
-
-MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_NO_ARGS);
- // called when a client command is parsed
- // NOTE: hooks MUST start with if(MUTATOR_RETURNVALUE) return 0;
- // NOTE: return 1 if you handled the command, return 0 to continue handling
- // NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
- // INPUT
- string cmd_name; // command name
- int cmd_argc; // also, argv() can be used
- string cmd_string; // whole command, use only if you really have to
- /*
- // example:
- MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
- {
- if(MUTATOR_RETURNVALUE) // command was already handled?
- return 0;
- if(cmd_name == "echocvar" && cmd_argc >= 2)
- {
- print(cvar_string(argv(1)), "\n");
- return 1;
- }
- if(cmd_name == "echostring" && cmd_argc >= 2)
- {
- print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
- return 1;
- }
- return 0;
- }
- */
-
-MUTATOR_HOOKABLE(Spawn_Score, EV_NO_ARGS);
- // called when a spawnpoint is being evaluated
- // return 1 to make the spawnpoint unusable
- // INPUT
-// entity self; // player wanting to spawn
-// entity spawn_spot; // spot to be evaluated
- // IN+OUT
- vector spawn_score; // _x is priority, _y is "distance"
+/**
+ * called when a client command is parsed
+ * NOTE: hooks MUST start with if(MUTATOR_RETURNVALUE) return 0;
+ * NOTE: return 1 if you handled the command, return 0 to continue handling
+ * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
+ * // example:
+ * MUTATOR_HOOKFUNCTION(foo_SV_ParseClientCommand)
+ * {
+ * if (MUTATOR_RETURNVALUE) // command was already handled?
+ * return false;
+ * if (cmd_name == "echocvar" && cmd_argc >= 2)
+ * {
+ * print(cvar_string(argv(1)), "\n");
+ * return true;
+ * }
+ * if (cmd_name == "echostring" && cmd_argc >= 2)
+ * {
+ * print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
+ * return true;
+ * }
+ * return false;
+ * }
+ */
+#define EV_SV_ParseClientCommand(i, o) \
+ /** command name */ i(string, cmd_name) \
+ /** also, argv() can be used */ i(int, cmd_argc) \
+ /** whole command, use only if you really have to */ i(string, cmd_string) \
+ /**/
+string cmd_name;
+int cmd_argc;
+string cmd_string;
+MUTATOR_HOOKABLE(SV_ParseClientCommand, EV_SV_ParseClientCommand);
+
+/**
+ * called when a spawnpoint is being evaluated
+ * return 1 to make the spawnpoint unusable
+ */
+#define EV_Spawn_Score(i, o) \
+ /** player wanting to spawn */ i(entity, self) \
+ /** spot to be evaluated */ i(entity, spawn_spot) \
+ /** _x is priority, _y is "distance" */ i(vector, spawn_score) \
+ /**/ o(vector, spawn_score) \
+ /**/
+vector spawn_score;
+MUTATOR_HOOKABLE(Spawn_Score, EV_Spawn_Score);
+
+/** runs globally each server frame */
MUTATOR_HOOKABLE(SV_StartFrame, EV_NO_ARGS);
- // runs globally each server frame
-MUTATOR_HOOKABLE(SetModname, EV_NO_ARGS);
- // OUT
-// string modname; // name of the mutator/mod if it warrants showing as such in the server browser
+#define EV_SetModname(i, o) \
+ /** name of the mutator/mod if it warrants showing as such in the server browser */ \
+ o(string, modname) \
+ /**/
+MUTATOR_HOOKABLE(SetModname, EV_SetModname);
-MUTATOR_HOOKABLE(Item_Spawn, EV_NO_ARGS);
- // called for each item being spawned on a map, including dropped weapons
- // return 1 to remove an item
- // INPUT
-// entity self; // the item
+/**
+ * called for each item being spawned on a map, including dropped weapons
+ * return 1 to remove an item
+ */
+#define EV_Item_Spawn(i, o) \
+ /** the item */ i(entity, self) \
+ /**/
+MUTATOR_HOOKABLE(Item_Spawn, EV_Item_Spawn);
-MUTATOR_HOOKABLE(SetWeaponreplace, EV_NO_ARGS);
- // IN
-// entity self; // map entity
-// entity other; // weapon info
- // IN+OUT
-// string ret_string;
+#define EV_SetWeaponreplace(i, o) \
+ /** map entity */ i(entity, self) \
+ /** weapon info */ i(entity, other) \
+ /**/ i(string, ret_string) \
+ /**/ o(string, ret_string) \
+ /**/
+MUTATOR_HOOKABLE(SetWeaponreplace, EV_SetWeaponreplace);
+/** called when an item is about to respawn */
MUTATOR_HOOKABLE(Item_RespawnCountdown, EV_NO_ARGS);
- // called when an item is about to respawn
// INPUT+OUTPUT:
string item_name;
vector item_color;
+/** called when a bot checks a target to attack */
MUTATOR_HOOKABLE(BotShouldAttack, EV_NO_ARGS);
- // called when a bot checks a target to attack
// INPUT
entity checkentity;
-MUTATOR_HOOKABLE(PortalTeleport, EV_NO_ARGS);
- // called whenever a player goes through a portal gun teleport
- // allows you to strip a player of an item if they go through the teleporter to help prevent cheating
- // INPUT
-// entity self;
+/**
+ * called whenever a player goes through a portal gun teleport
+ * allows you to strip a player of an item if they go through the teleporter to help prevent cheating
+ */
+ #define EV_PortalTeleport(i, o) \
+ /**/ i(entity, self) \
+ /**/
+MUTATOR_HOOKABLE(PortalTeleport, EV_PortalTeleport);
MUTATOR_HOOKABLE(HelpMePing, EV_NO_ARGS);
// called whenever a player uses impulse 33 (help me) in cl_impulse.qc