REGISTER_NET_TEMP(globalsound)
REGISTER_NET_TEMP(playersound)
- string GlobalSound_sample(string pair, float r);
-
#ifdef SVQC
/**
* @param from the source entity, its position is sent
//#endif
entity GetVoiceMessage(string type);
+string GlobalSound_sample(string pair, float r);
+
#ifdef SVQC
void _GlobalSound(entity this, entity gs, entity ps, string sample, float chan, float vol, float voicetype, bool fake);
if(delaytoo)
if(time < this.msound_delay)
return; // too early
- GlobalSound_string(this, this.(samplefield), chan, VOL_BASE, VOICETYPE_PLAYERSOUND);
+ string sample = this.(samplefield);
+ if (sample != "") sample = GlobalSound_sample(sample, random());
+ float myscale = ((this.scale) ? this.scale : 1); // safety net
+ float scale_inverse = 1 / myscale;
+ // TODO: change volume depending on size too?
+ sound7(this, chan, sample, VOL_BASE, ATTEN_NORM, scale_inverse * 100, 0);
this.msound_delay = time + sound_delay;
}