| mati009988 |
08-10-2010 04:45 |
Small problem with loop
Hi!
I`ve got a small problem with loop in roundsound.
When someone say rs no one hear music.
What is wrong?
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <ColorChat>
new bool:wylacz[33]
new const tytul1[]="author/title"
new const piosenka1[]="misc/sound.mp3"
new const tytul2[]="author/title"
new const piosenka2[]="misc/sound.mp3"
new const tytul3[]="author/title"
new const piosenka3[]="misc/sound.mp3"
new const tytul4[]="author/title"
new const piosenka4[]="misc/sound.mp3"
new const tytul5[]="author/title"
new const piosenka5[]="misc/sound.mp3"
new const tytul6[]="author/title"
new const piosenka6[]="misc/sound.mp3"
new const tytul7[]="author/title"
new const piosenka7[]="misc/sound.mp3"
new const tytul8[]="author/title"
new const piosenka8[]="misc/sound.mp3"
new const tytul9[]="author/title"
new const piosenka9[]="misc/sound.mp3"
new const tytul10[]="author/title"
new const piosenka10[]="misc/sound.mp3"
new const tytul11[]="author/title"
new const piosenka11[]="misc/sound.mp3"
public plugin_init() {
register_plugin("RoundSound", "1.0", "S!p")
register_logevent("KoniecRundy",2,"1=Round_End")
register_clcmd("say roundsound", "roundsound")
register_clcmd("say /roundsound", "roundsound")
register_clcmd("say_team roundsound", "roundsound")
register_clcmd("say_team /roundsound", "roundsound")
register_clcmd("say roundsound", "roundsound")
register_clcmd("say rs", "roundsound")
register_clcmd("say_team rs", "roundsound")
}
public client_connect(i) wylacz[i] = false
public KoniecRundy(i){
for(new i=1 ; i<=32 ; i++){
if(!is_user_connected(i)) return PLUGIN_HANDLED_MAIN
switch (random_num(1,11)){
case 1: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka1)
ColorChat(0, RED, "[RS] %s",tytul1)
}
case 2: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka2)
ColorChat(0, RED, "[RS] %s",tytul2)
}
case 3: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka3)
ColorChat(0, RED, "[RS] %s",tytul3)
}
case 4: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka4)
ColorChat(0, RED, "[RS] %s",tytul4)
}
case 5: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka5)
ColorChat(0, RED, "[RS] %s",tytul5)
}
case 6: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka6)
ColorChat(0, RED, "[RS] %s",tytul6)
}
case 7: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka7)
ColorChat(0, RED, "[RS] %s",tytul7)
}
case 8: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka8)
ColorChat(0, RED, "[RS] %s",tytul8)
}
case 9: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka9)
ColorChat(0, RED, "[RS] %s",tytul9)
}
case 10: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka10)
ColorChat(0, RED, "[RS] %s",tytul10)
}
case 11: {
if(wylacz[i]) return PLUGIN_HANDLED
client_cmd(0, "mp3 stop")
client_cmd(0, "stopsound")
client_cmd(0, "mp3 play sound/%s", piosenka11)
ColorChat(0, RED, "[RS] %s",tytul11)
}
}
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public roundsound(i){
if(wylacz[i]){
wylacz[i] = false
ColorChat(i, RED, "[RS]^x01 RoundSound ^x04on")
}
else {
wylacz[i] = true
ColorChat(i, RED, "[RS]^x01 RoundSound ^x04off")
}
}
public plugin_precache(){
precache_sound(piosenka1)
precache_sound(piosenka2)
precache_sound(piosenka3)
precache_sound(piosenka4)
precache_sound(piosenka5)
precache_sound(piosenka6)
precache_sound(piosenka7)
precache_sound(piosenka8)
precache_sound(piosenka9)
precache_sound(piosenka10)
precache_sound(piosenka11)
}
|