I need help on trying to basically understand the random command. I'm still a newbie in this and the help was confusing me. I'm trying to make it so that for the ultimate_sounds plugin plays randomly 3 sounds instead of just the normal "Headshot" sound. Here is what I
ADDED to the plugin (if you want to fix the errors yourself by compiling instead of reading this, I uploaded the plugin):
Code:
#define HSSOUNDS 4
new hssounds[HSSOUNDS][] = {
"spk misc/headshot",
"spk misc/fps_headshot",
"spk misc/headshot3"}
precache_sound( "misc/fps_headshot.wav")
precache_sound( "misc/headshot3.wav")
Then I changed this part of the script (which is at the end in the hs section, above the precache_sound):
Code:
}
if (hsmode_bit & 2){
client_cmd(0,"spk misc/fps_headshot")
}
to:
Code:
}
if (hsmode_bit & 2){
client_cmd(0,hssounds[ random_num(0,HSSOUNDS-1) ],)
}
after this, I tried compiling the plugin but this is what I got:
on line 66 (error 008: must be a constant expression; assumed zero)
on line 297 (error 029: invalid expression, assumed zero)
my line 66 was:
client_cmd(0,"spk misc/headshot"),
and my line 297 was:
client_cmd(0,hssounds[ random_num(0,HSSOUNDS-1) ],)
like I said I'm a newbie and I'm totally lost -_-' and I'm sorry for making this really long lol but I thought that everything I did was necessary?[/list]