Quote:
Originally Posted by siriusmd99
client_cmd(0, "spk %s", sounds[random_num(0, MAX_SOUNDS)])
To:
client_cmd(0, "spk %s", sounds[random_num(0, MAX_SOUNDS - 1)])
You have 8 sounds but array starts with 0 .
Sounds[0] = sound1
Sounds[7] = sound8
And sound[8] shall be null.
|
Just do random( MAX_SOUNDS ) , this automatically does 0 to num-1.
Sound[8] shall be index out of bounds, not null.
__________________