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"
-set sv_hitsound_antispam_time 0.05 "don't play the hitsound more often than this for the electro lightning gun or the laser gauntlet"
+seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
+set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
//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)"
seta cl_sound_maptime_warning "1" "play announcer sound telling you the remaining maptime - 0: do not play at all, 1: play at one minute, 2: play at five minutes, 3: play both"
seta cl_notify_carried_items "3" "notify you of carried items when you obtain them (e.g. flags in CTF) - 0: disabled, 1: notify of taken items, 2: notify of picking up dropped items, 3: notify of both"
-seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
seta cl_announcer default "name of the announcer you wish to use from data/sound/announcer"
// startmap_dm is used when running with the -listen or -dedicated commandline options
WaypointSprite_Load();
// precaches
+ precache_sound("misc/hit.wav");
+ precache_sound("misc/typehit.wav");
Projectile_Precache();
Hook_Precache();
GibSplash_Precache();
entity nightvision_noise, nightvision_noise2;
float pickup_crosshair_time, pickup_crosshair_size;
+float hit_time, typehit_time;
+float nextsound_hit_time, nextsound_typehit_time;
float hitindication_crosshair_time, hitindication_crosshair_size;
float use_nex_chargepool;
scoreboard_active = HUD_WouldDrawScoreboard();
+ hit_time = getstatf(STAT_HIT_TIME);
+ if(hit_time > nextsound_hit_time && autocvar_cl_hitsound)
+ {
+ sound(world, CHAN_AUTO, "misc/hit.wav", VOL_BASE, ATTN_NONE);
+ nextsound_hit_time = time + autocvar_cl_hitsound_antispam_time;
+ }
+ typehit_time = getstatf(STAT_TYPEHIT_TIME);
+ if(typehit_time > nextsound_typehit_time)
+ {
+ sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
+ nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
+ }
+
float hud;
hud = getstati(STAT_HUD);
if(hud == HUD_SPIDERBOT)
if(autocvar_crosshair_hitindication)
{
hitindication_color = stov(autocvar_crosshair_hitindication_color);
- if(hitindication_crosshair_time < getstatf(STAT_HIT_TIME))
+ if(hitindication_crosshair_time < hit_time)
{
hitindication_crosshair_size = 1;
- hitindication_crosshair_time = getstatf(STAT_HIT_TIME);
+ hitindication_crosshair_time = hit_time;
}
if(hitindication_crosshair_size > 0)
float autocvar_vid_pixelheight;
float autocvar_viewsize;
float autocvar_crosshair_color_by_health;
+float autocvar_cl_hitsound;
+float autocvar_cl_hitsound_antispam_time;
const float STAT_HUD = 51;
const float STAT_NEX_CHARGEPOOL = 52;
const float STAT_HIT_TIME = 53;
+const float STAT_TYPEHIT_TIME = 54;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
float autocvar_sv_friction_on_land;
float autocvar_sv_gameplayfix_q2airaccelerate;
#define autocvar_sv_gravity cvar("sv_gravity")
-float autocvar_sv_hitsound_antispam_time;
string autocvar_sv_intermission_cdtrack;
string autocvar_sv_jumpspeedcap_max;
float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
.float last_pickup;
.float hit_time;
+.float typehit_time;
.float stat_leadlimit;
if(damage > 0)
{
if(deathtype != DEATH_FIRE)
- if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
if(targ.BUTTON_CHAT)
attacker.typehitsound += 1;
else
attacker.hitsound += 1;
- attacker.prevhitsound = time;
- attacker.hit_time = time;
}
damage_goodhits += 1;
else
{
if(deathtype != DEATH_FIRE)
- if(attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
{
attacker.typehitsound += 1;
- attacker.prevhitsound = time;
}
if(mirrordamage > 0)
if(time > attacker.teamkill_complain)
addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter);
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_HIT_TIME, AS_FLOAT, hit_time);
+ addstat(STAT_TYPEHIT_TIME, AS_FLOAT, typehit_time);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
if(self.classname == "spectator")
{
if(self.enemy.typehitsound)
- play2(self, "misc/typehit.wav");
+ self.typehit_time = time;
else if(self.enemy.hitsound && self.cvar_cl_hitsound)
- play2(self, "misc/hit.wav");
+ self.hit_time = time;
}
else
{
if(self.typehitsound)
- play2(self, "misc/typehit.wav");
+ self.typehit_time = time;
else if(self.hitsound && self.cvar_cl_hitsound)
- play2(self, "misc/hit.wav");
+ self.hit_time = time;
}
}
altime = time + frametime * (1 + autocvar_g_antilag_nudge);
precache_sound ("misc/gib_splat02.wav");
precache_sound ("misc/gib_splat03.wav");
precache_sound ("misc/gib_splat04.wav");
- precache_sound ("misc/hit.wav");
- precache_sound ("misc/typehit.wav");
PrecacheGlobalSound((globalsound_fall = "misc/hitground 4"));
PrecacheGlobalSound((globalsound_metalfall = "misc/metalhitground 4"));
precache_sound ("misc/null.wav");
precache_model ("models/elaser.mdl");
precache_sound ("nexball/shoot1.wav");
precache_sound ("nexball/shoot2.wav");
+ precache_sound ("misc/typehit.wav");
}
else if (req == WR_SETUP)
weapon_setup(WEP_PORTO);