]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/base.qh
Merge remote-tracking branch 'origin/master' into samual/mutator_ctf
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / base.qh
index e26280e61a695cf0fedcff92ff3fd487c803a830..f9a23e5f8d2214f26ce75453b039e172822cc5d4 100644 (file)
@@ -45,6 +45,7 @@ MUTATOR_HOOKABLE(MakePlayerObserver);
        // called when a player becomes observer, after shared setup
 
 MUTATOR_HOOKABLE(PlayerSpawn);
+       entity spawn_spot; // spot that was used, or world
        // called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here)
 
 MUTATOR_HOOKABLE(ClientDisconnect);
@@ -159,3 +160,97 @@ MUTATOR_HOOKABLE(PlayerUseKey);
        // 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);
+       // 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
+       float 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);
+       // 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"
+
+MUTATOR_HOOKABLE(SV_StartFrame);
+       // runs globally each server frame
+
+MUTATOR_HOOKABLE(SetModname);
+       // OUT
+       string modname; // name of the mutator/mod if it warrants showing as such in the server browser
+
+MUTATOR_HOOKABLE(SetWeaponreplace);
+       // IN
+               entity self; // map entity
+               entity other; // weapon info
+       // IN+OUT
+               string ret_string;
+
+MUTATOR_HOOKABLE(PortalTeleport);
+       // 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;
+       
+MUTATOR_HOOKABLE(HelpMePing);
+       // called whenever a player uses impulse 33 (help me) in cl_impulse.qc
+       // normally help me ping uses self.waypointsprite_attachedforcarrier,
+       // but if your mutator uses something different then you can handle it
+       // in a special manner using this hook
+       // INPUT
+       entity self; // the player who pressed impulse 33
+       
+MUTATOR_HOOKABLE(VehicleEnter);
+       // called when a player enters a vehicle
+       // allows mutators to set special settings in this event
+       // INPUT
+       entity vh_player; // player
+       entity vh_vehicle; // vehicle
+       
+MUTATOR_HOOKABLE(VehicleExit);
+       // called when a player exits a vehicle
+       // allows mutators to set special settings in this event
+       // INPUT
+       entity vh_player; // player
+       entity vh_vehicle; // vehicle
+       
+MUTATOR_HOOKABLE(AbortSpeedrun);
+       // called when a speedrun is aborted and the player is teleported back to start position
+       // INPUT
+       entity self; // player
+
+MUTATOR_HOOKABLE(ItemTouch);
+       // called at when a item is touched. Called early, can edit item properties.
+       entity self;    // item
+       entity other;   // player
+
+MUTATOR_HOOKABLE(ClientConnect);
+       // called at when a player connect
+       entity self;    // player