okey... this is the code...
Code:
#include <amxmodx>
#define MAXSOUNDS 2
new soundlist[MAXSOUNDS][] = {"Prologue","Nightwish"}
new i
public precache() {
i = random_num(0,MAXSOUNDS-1)
if (i == 0) {
precache_sound("mp3/Prologue.mp3")
}
if (i == 1) {
precache_sound("mp3/Nightwish.mp3")
}
}
public client_connect(id) {
client_cmd(id,"mp3 play mp3/%s",soundlist[i])
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("ConnectSound","1.0","[ --<-@ ]")
}
if i put this in plugin_precache()
Code:
i = random_num(0,MAXSOUNDS-1)
"i" would be assigned the same number in client_connect() that it had from plugin_precache() so it plays the same song as precached? right?
and there another way to make the plugin play the sounds when the user is dling stuff... so if i do like this...
Code:
#include <amxmodx>
#define MAXSOUNDS 2
new soundlist[MAXSOUNDS][] = {"Prologue","Nightwish"}
public precache() {
new i
i = random_num(0,MAXSOUNDS-1)
{
if (i == 0) {
precache_sound("mp3/Prologue.mp3")
}
if (i == 1) {
precache_sound("mp3/Nightwish.mp3")
}
}
client_cmd(id,"mp3 play mp3/%s",soundlist[i])
}
public plugin_init() {
register_plugin("ConnectSound","1.0","[ --<-@ ]")
}
would the user hear the sound when they are downloading? would that work?