Raised This Month: $ Target: $400
 0% 

Small problem with loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
t3hNox
Senior Member
Join Date: Oct 2009
Old 08-10-2010 , 06:16   Re: Small problem with loop
Reply With Quote #2

Have a try.
PHP Code:
#include <amxmodx> 
//#include <ColorChat>  //Uncomment

#define AMOUNT 11   // Total amount of songs/artists

new bool:DontPlay[33] = false

new const TITLE[AMOUNT][] =
{
    
"author/title",  // 1st song's title and author
    
"author/title",  // 2nd song's title and author
    
"author/title",  // ..
    
"author/title",
    
"author/title",
    
"author/title",
    
"author/title",
    
"author/title",
    
"author/title",
    
"author/title",
    
"author/title"   // no comma
}
    
new const 
MUSIC[AMOUNT][] =
{
    
"misc/sound.mp3"// 1st song
    
"misc/sound.mp3"// 2nd song
    
"misc/sound.mp3"// ...
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3",
    
"misc/sound.mp3"  // no comma
}

public 
plugin_init() { 
    
register_plugin("RoundSound""1.0""S!p"
    
register_logevent("KoniecRundy",1,"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(iDontPlay[i] = false 

public KoniecRundy(i)
{
    new 
RandSong random_num(1AMOUNT)
    for(new 
i=i<=32 i++) 
    {
        if(!
DontPlay[i])
        {
            
client_cmd(i"mp3 stop"
            
client_cmd(i"stopsound"
            
client_cmd(i"mp3 play %s"MUSIC[RandSong]) 
            
client_print(iprint_chat"Now playing %s"TITLE[RandSong])
        }
    }



public 
roundsound(id)

    if(
DontPlay[id]) 
        
DontPlay[id] = false
    
else 
        
DontPlay[id] = true
    client_print
(idprint_chat"Round sound is %s."DontPlay[id] ? "ON" "OFF")    


public 
plugin_precache()

    for(new 
1<= AMOUNTi++)
    {
        
precache_sound(MUSIC[i]) 
    }  

t3hNox is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode