X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fevents.qh;h=ca3ce6fcc82ac4b03e3a3a29092463942d00e6da;hp=202131a22c7badb1e3849286c2f4ee389bbdaeb5;hb=bc50c2d7ca3e0a44ed1712400ef8e170e6df8210;hpb=5474a5152e728066668d1399703cb2fba4fd9124 diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 202131a22c..ca3ce6fcc8 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -3,7 +3,7 @@ #include // register all possible hooks here - + // to use a hook, first register your mutator using REGISTER_MUTATOR // then create your function using MUTATOR_HOOKFUNCTION @@ -27,6 +27,12 @@ MUTATOR_HOOKABLE(PutClientInServer, EV_PutClientInServer); /**/ MUTATOR_HOOKABLE(ForbidSpawn, EV_ForbidSpawn); +/** returns true if client should be put as player on connection */ +#define EV_AutoJoinOnConnection(i, o) \ + /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(AutoJoinOnConnection, EV_AutoJoinOnConnection); + /** called when player spawns to determine whether to give them random start weapons. Return true to forbid giving them. */ #define EV_ForbidRandomStartWeapons(i, o) \ /** player */ i(entity, MUTATOR_ARGV_0_entity) \ @@ -411,7 +417,8 @@ MUTATOR_HOOKABLE(PlayerDamage_SplitHealthArmor, EV_PlayerDamage_SplitHealthArmor /** mirrordamage */ i(float, MUTATOR_ARGV_5_float) \ /** mirrordamage */ o(float, MUTATOR_ARGV_5_float) \ /** force */ i(vector, MUTATOR_ARGV_6_vector) \ - /** force */ o(vector, MUTATOR_ARGV_6_vector) \ + /** force */ o(vector, MUTATOR_ARGV_6_vector) \ + /** weapon entity */ i(entity, MUTATOR_ARGV_7_entity) \ /**/ MUTATOR_HOOKABLE(Damage_Calculate, EV_Damage_Calculate); @@ -435,6 +442,8 @@ MUTATOR_HOOKABLE(PlayerDamaged, EV_PlayerDamaged); #define EV_W_DecreaseAmmo(i, o) \ /** actor */ i(entity, MUTATOR_ARGV_0_entity) \ /** weapon entity */ i(entity, MUTATOR_ARGV_1_entity) \ + /** ammo to take */ i(float, MUTATOR_ARGV_2_float) \ + /**/ o(float, MUTATOR_ARGV_2_float) \ /**/ MUTATOR_HOOKABLE(W_DecreaseAmmo, EV_W_DecreaseAmmo); @@ -1104,6 +1113,13 @@ MUTATOR_HOOKABLE(Item_ScheduleRespawn, EV_Item_ScheduleRespawn); /**/ MUTATOR_HOOKABLE(PlayerPhysics_UpdateStats, EV_PlayerPhysics_UpdateStats); +/** called after physics stats are set on a player, allows post-initialization modifications */ +#define EV_PlayerPhysics_PostUpdateStats(i, o) \ + /** player */ i(entity, MUTATOR_ARGV_0_entity) \ + /** maxspeed_mod */ i(float, MUTATOR_ARGV_1_float) \ + /**/ +MUTATOR_HOOKABLE(PlayerPhysics_PostUpdateStats, EV_PlayerPhysics_PostUpdateStats); + /** return true to use your own aim target (or none at all) */ #define EV_HavocBot_Aim(i, o) \ /** bot */ i(entity, MUTATOR_ARGV_0_entity) \