Okay start off my opening the hknight.qc
scroll down to this
// set missile speed<br /> vec = normalize (v_forward);<br /> vec_z = 0 - vec_z + (random() - 0.5)*0.1;<br /> <br /> launch_spike (org, vec);<br /> newmis.classname = "knightspike";<br /> setmodel (newmis, "progs/k_spike.mdl");<br /> setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); <br /> newmis.velocity = vec*300;<br /> sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
now
infront of this:
sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
Add:
local float r;<br /> \r = rint(random() * 4);
so it looks like this:
local float r;
r = rint(random() * 4);
sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
now for the simple if statements:
add before of sound (self etc
if (r == 1)
no now it looks like:
local float r;
r = rint(random() * 4);
if (r == 1)
sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
cool so now you have 1 but you have set the random for 4 not 1 so do this:
local float r;
r = rint(random() * 4);
if (r == 1)
sound (self, CHAN_WEAPON, "hknight/attack1.wav", 1, ATTN_NORM);
if (r == 2)
sound (self, CHAN_WEAPON, "hknight/attack2.wav", 1, ATTN_NORM);
if (r == 3)
sound (self, CHAN_WEAPON, "hknight/attack3.wav", 1, ATTN_NORM);
if (r == 4)
sound (self, CHAN_WEAPON, "hknight/attack4.wav", 1, ATTN_NORM);
now open world.qc and under
precache_sound ("misc/water1.wav"); // swimming
precache_sound ("misc/water2.wav"); // swimming
add
precache_sound ("hknight/attack1.wav");
precache_sound ("hknight/attack2.wav");
precache_sound ("hknight/attack3.wav");
precache_sound ("hknight/attack4.wav");
now place your sounds into the hknight folder compile and run
and there you have it the hellknight will play 4 sounds randomly instead of 1
it seems you have html in your qc..
FAIL!