if (previous_game_starttime != startTime) {
if ((time + 5.0) < startTime) {
//if connecting to server while restart was active don't always play prepareforbattle
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
}
if (time < startTime) {
restartAnnouncer = spawn();
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);
+ sound(world, CH_INFO, "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);
+ sound(world, CH_INFO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
}
if(oldmask & mv_maps_mask != oldmask)
if(oldmask & mv_maps_mask == mv_maps_mask)
- sound(world, CHAN_AUTO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
+ sound(world, CH_INFO, "misc_invshot.wav", VOL_BASE, ATTN_NONE);
// remove votes that no longer apply
for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2)
// check for pending announcement, play it and remove it
if(announce_snd != "")
{
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
strunzone(announce_snd);
announce_snd = "";
}
if (!spectatee_status) //do cprint only for players
centerprint(_("^1Begin!"));
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
//reset maptime announcers now as well
announcer_5min = announcer_1min = FALSE;
centerprint(sprintf(_("^1Game starts in %d seconds"), countdown_rounded));
if(countdown_rounded <= 3 && countdown_rounded >= 1) {
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
}
self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
//if we're in warmup mode, check whether there's a warmup timelimit
if not (warmuplimit == -1 && warmup_stage) {
announcer_5min = TRUE;
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
}
}
//if we're in warmup mode, check whether there's a warmup timelimit
if not (warmuplimit == -1 && warmup_stage) {
announcer_1min = TRUE;
- sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
+ sound(world, CH_INFO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
}
}
}
if(clienttype(self) == CLIENTTYPE_REAL)
if(floor(finished - time - frametime) != floor(finished - time))
if(finished - time < 6)
- sound (self, CHAN_AUTO, samp, VOL_BASE, ATTN_NORM);
+ sound (self, CH_INFO, samp, VOL_BASE, ATTN_NORM);
}
/**
(time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
) // prevent insane sound spam
{
- sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ sound(ent, CH_ITEMS, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
ent.prevstrengthsound = time;
}
ent.prevstrengthsoundattempt = time;
if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
{
- sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+ sound (self, CH_WEAPON_A, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
self.prevdryfire = time;
}
}
}
- sound (other, CHAN_AUTO, self.noise2, VOL_BASE, ATTN_NONE);
+ sound (other, CH_ITEMS, self.noise2, VOL_BASE, ATTN_NONE);
WaypointSprite_DetachCarrier(other);
if(self.speedrunning)
FakeTimeLimit(other, -1);
self.dropperid = other.playerid;
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("steal", self.team, other);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
}
PlayerScore_Add(other, SP_CTF_RETURNS, 1);
LogCTF("return", self.team, other);
- sound (other, CHAN_AUTO, self.noise1, VOL_BASE, ATTN_NONE);
+ sound (other, CH_ITEMS, self.noise1, VOL_BASE, ATTN_NONE);
ReturnFlag(self);
}
else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
UpdateFrags(other, f);
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("pickup", self.team, other);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
if (head.noise != "")
if(self.enemy)
- sound(self.enemy, CHAN_AUTO, head.noise, VOL_BASE, ATTN_NORM);
+ sound(self.enemy, CH_ITEMS, head.noise, VOL_BASE, ATTN_NORM);
else
- sound(self, CHAN_TRIGGER, head.noise, VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGERS_SINGLE, head.noise, VOL_BASE, ATTN_NORM);
if (head.noise1 != "")
play2all(head.noise1);
func_breakable_destroyed();
if(self.noise)
- sound (self, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self, CH_TRIGGERS_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
if(self.dmg)
RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, self.dmg_force, DEATH_HURTTRIGGER, world);
}
if (self.noise)
- sound (self.enemy, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+ sound (self.enemy, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
// don't trigger again until reset
self.takedamage = DAMAGE_NO;
{
other.health = min(other.health + self.health, self.max_health);
other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
}
}
}
{
other.gravity = g;
if(self.noise != "")
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
UpdateCSQCProjectile(self.owner);
}
};
{
//stuffcmd(e, strcat("play2 ", filename, "\n"));
msg_entity = e;
- soundtoat(MSG_ONE, world, '0 0 0', CHAN_AUTO, filename, VOL_BASE, ATTN_NONE);
+ soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTN_NONE);
}
// use this one if you might be causing spam (e.g. from touch functions that might get called more than once per frame)
if (autocvar_bot_sound_monopoly)
return;
- sound(world, CHAN_AUTO, samp, VOL_BASE, ATTN_NONE);
+ sound(world, CH_INFO, samp, VOL_BASE, ATTN_NONE);
}
void PrecachePlayerSounds(string f);
WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
- sound(self, CHAN_AUTO, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self, CH_TRIGGERS_SINGLE, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
}
else
{
if(other.classname != "player")
{ // The ball just touched an object, most likely the world
pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
- sound(self, CHAN_AUTO, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGERS_SINGLE, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
return;
}
else if(self.wait > time) { return; }
Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
- sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self.owner, CH_ITEMS, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
- sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(plyr, CH_ITEMS, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
void kh_Key_Collect(entity key, entity player) //a player picks up a dropped key
{
- sound(player, CHAN_AUTO, kh_sound_collect, VOL_BASE, ATTN_NORM);
+ sound(player, CH_ITEMS, kh_sound_collect, VOL_BASE, ATTN_NORM);
if(key.kh_dropperteam != player.team)
{
{
if(self.siren_time < time)
{
- sound(self.owner, CHAN_AUTO, kh_sound_alarm, VOL_BASE, ATTN_NORM); // play a simple alarm
+ sound(self.owner, CH_ITEMS, kh_sound_alarm, VOL_BASE, ATTN_NORM); // play a simple alarm
self.siren_time = time + 2.5; // repeat every 2.5 seconds
}
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
key.kh_dropperteam = key.team;
- sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
}
void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
if(suicide)
key.kh_dropperteam = player.team;
}
- sound(player, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
+ sound(player, CH_ITEMS, kh_sound_drop, VOL_BASE, ATTN_NORM);
}
}
pscore = 1;
}
- sound (ball, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+ sound (ball, CH_TRIGGERS_SINGLE, self.noise, VOL_BASE, ATTN_NONE);
if(ball.team && pscore)
{
if(!attacker.ballcarried)
{
LogNB("stole", attacker);
- sound (other, CHAN_AUTO, ball.noise2, VOL_BASE, ATTN_NORM);
+ sound (other, CH_ITEMS, ball.noise2, VOL_BASE, ATTN_NORM);
if(attacker.team == other.team && time > attacker.teamkill_complain)
{
if (!pickedup)
return 0;
- sound (player, CHAN_AUTO, item.item_pickupsound, VOL_BASE, ATTN_NORM);
+ sound (player, CH_ITEMS, item.item_pickupsound, VOL_BASE, ATTN_NORM);
if (_switchweapon)
if (player.switchweapon != w_getbestweapon(player))
W_SwitchWeapon_Force(player, w_getbestweapon(player));
if(v1 <= v0 - t)
{
if(snd_decr != "")
- sound (e, CHAN_AUTO, snd_decr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_ITEMS, snd_decr, VOL_BASE, ATTN_NORM);
}
else if(v0 >= v0 + t)
{
if(snd_incr != "")
- sound (e, CHAN_AUTO, snd_incr, VOL_BASE, ATTN_NORM);
+ sound (e, CH_ITEMS, snd_incr, VOL_BASE, ATTN_NORM);
}
}
{
// flash when activated
pointparticles(particleeffectnum("jumppad_activate"), other.origin, other.velocity, 1);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
+ sound (other, CH_ITEMS, self.noise, VOL_BASE, ATTN_NORM);
self.pushltime = time + 0.2;
}
local float ct;