I'm really Noob in scripting

Now the script looks like this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#define Maxsounds 10
new soundlist[Maxsounds][64]
new soundCount = 0
new bool:music[33]
public plugin_init() {
register_plugin("Loading Music","0.9","Andrax2000")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1)
return PLUGIN_CONTINUE
}
public plugin_precache() {
new dh
new nameFull[64], name[64], nameExt[32]
dh = open_dir("sound/mindtricks", nameFull, 63)
do
{
strtok(nameFull,name,63,nameExt,31,'.')
if (equali(nameExt, "mp3")) {
soundlist[soundCount] = name
soundCount++
}
}
while(soundCount<Maxsounds && next_file(dh, nameFull, 63))
close_dir(dh)
server_print("[AMXX LOADING MUSIC] Found %i mp3s", soundCount)
for (new i = 0; i < soundCount; i++)
{
format(name, 63, "sound/mindtricks/%s.mp3",soundlist[i])
precache_generic(name)
}
return PLUGIN_CONTINUE
}
public client_connect(id) {
music[id] = true;
new i
i = random_num(0,soundCount-1)
client_cmd(id,"mp3 play sound/mindtricks/%s",soundlist[i])
}
public fw_PlayerSpawn(id) {
music[id] = false;
}
And doesn't work - of course

Music stops when a player is connected.
Help please?
__________________