34 float total_score = 0;
35 float totalplayers = 0;
41 if (totalplayers == 0)
44 float mean_score = total_score / totalplayers;
48 float handicap =
fabs((score - mean_score) *
51 if (score < mean_score)
61 handicap = 1 / (
fabs(handicap) + 1);
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void Handicap_SetForcedHandicap(entity player, float value, bool receiving)
Sets the forced handicap of the player.
#define HANDICAP_DISABLED()
#define PutClientInServer
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define PlayerScore_Get(player, scorefield)
Returns the player's score.
float autocvar_g_dynamic_handicap_max
The maximum value of the handicap.
float autocvar_g_dynamic_handicap_scale
The scale of the handicap.
int autocvar_g_dynamic_handicap
Whether to enable dynamic handicap.
float autocvar_g_dynamic_handicap_exponent
The exponent used to calculate handicap.
void DynamicHandicap_UpdateHandicap()
Updates the handicap of all players.
float DynamicHandicap_ClampHandicap(float handicap)
Clamps the value of the handicap.
float autocvar_g_dynamic_handicap_min
The minimum value of the handicap.
#define FOREACH_CLIENT(cond, body)