void stopsoundto(int _dest, entity e, int chan)
{
if (!sound_allowed(_dest, e)) return;
- int entno = num_for_edict(e);
+ int entno = etof(e);
if (entno >= 8192 || chan < 0 || chan > 7)
{
int idx = precache_sound_index(SND(Null));
void play2(entity e, string filename)
{
msg_entity = e;
- soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
+ soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
}
.float spamtime;
void play2team(float t, string filename)
{
if (autocvar_bot_sound_monopoly) return;
- entity head;
- FOR_EACH_REALPLAYER(head)
- {
- if (head.team == t) play2(head, filename);
- }
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == t, play2(it, filename));
}
void play2all(string samp)
{
if (autocvar_bot_sound_monopoly) return;
- _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
+ _sound(NULL, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
}
#endif