set sv_ready_restart_after_countdown 0 "if set to 1 the players and map items are reset after the countdown ended, otherwise they're reset already at the beginning of the countdown"
set sv_ready_restart_repeatable 0 "allows the players to restart the game as often as needed"
+sv_hitsound_antispam_time 0.05 "don't play the hitsound more often than this for the electro lightning gun or the laser gauntlet"
+
//nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
entity damage_targ;
entity damage_inflictor;
entity damage_attacker;
+.float prevhitsound;
void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
{
if(damage > 0)
{
- if(targ.BUTTON_CHAT)
- attacker.typehitsound += 1;
- else
- attacker.hitsound += 1;
+ if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && cvar("g_balance_electro_lightning") || attacker.weapon == WEP_LASER) && attacker.prevhitsound + cvar("sv_hitsound_antispam_time") < time))
+ {
+ if(targ.BUTTON_CHAT)
+ attacker.typehitsound += 1;
+ else
+ attacker.hitsound += 1;
+ attacker.prevhitsound = time;
+ }
damage_goodhits += 1;
damage_gooddamage += damage;