Raised This Month: $ Target: $400
 0% 

End Round Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-18-2015 , 20:02   End Round Sound
Reply With Quote #1

So I made this plugin, It Works really good, but I got this problem, It displays 4 times, 4 difrent messages, can someone help me?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <ColorChat>

#define PLUGIN "Musicas" 
#define VERSION "1.0" 
#define AUTHOR "Gh05t" 

new musica_1[]     = "sound/[frenzy]JailBreak/Musicas/1.mp3"
new musica_2[]     = "sound/[frenzy]JailBreak/Musicas/2.mp3"
new musica_3[]     = "sound/[frenzy]JailBreak/Musicas/3.mp3"
new musica_4[]     = "sound/[frenzy]JailBreak/Musicas/4.mp3"
new musica_5[]     = "sound/[frenzy]JailBreak/Musicas/5.mp3"
new musica_6[]     = "sound/[frenzy]JailBreak/Musicas/6.mp3"
new musica_7[]     = "sound/[frenzy]JailBreak/Musicas/7.mp3"
new musica_8[]     = "sound/[frenzy]JailBreak/Musicas/8.mp3"
new musica_9[]     = "sound/[frenzy]JailBreak/Musicas/9.mp3"
new musica_10[] = "sound/[frenzy]JailBreak/Musicas/10.mp3"

public plugin_precache()
{
    
precache_generic(musica_1);
    
precache_generic(musica_2);
    
precache_generic(musica_3);
    
precache_generic(musica_4);
    
precache_generic(musica_5);
    
precache_generic(musica_6);
    
precache_generic(musica_7);
    
precache_generic(musica_8);
    
precache_generic(musica_9);
    
precache_generic(musica_10);
}

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
   
    
register_logevent"LogEvent_RoundEnd",     2"1=Round_End"     );
}

public 
LogEvent_RoundEnd()
{    
    for( new 
i<=get_maxplayers();++ i)
    {
        if( 
is_user_connected(i))
        
TocarMusica();
    }
}

public 
TocarMusica()
{
    new 
iRand random_num(1,10
    switch(
iRand)
    { 
        case 
1
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_1);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Nils Van Zandt ft. Brooklyn Haley - For You")
            }
        } 
        case 
2
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_2);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Tungevaag & Raaban - Parade")
            }
        } 
        case 
3
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_3);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3ItaloBrothers & Floorfilla ft. P. Moody - One Heart")
            }
        }
        case 
4
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_4);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Redfoo - New Thang")
            }
        }
        case 
5
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_5);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Afrojack - Ten Feet Tall ft. Wrabel ")
            }
        }
        case 
6
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_6);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Bassjackers, Afrojack - What We Live For")
            }
        }
        case 
7
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_7);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Grits - My Life Be Like")
            }
        }
        case 
8
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_8);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3David Guetta - Lovers On The Sun ft. Sam Martin ")
            }
        }
        case 
9
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_9);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Skrillex & Damian Marley - Make It Bun Dem")
            }
        }
        case 
10
        { 
            
client_cmd(0"mp3 play ^"%s^""musica_10);
            {
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Eminem - Rap God")
            }
        }
    }

Gh05t04 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-18-2015 , 21:59   Re: End Round Sound
Reply With Quote #2

PHP Code:
ColorChat(0GREEN


PHP Code:
ColorChat(/*players index*/GREEN
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-18-2015 , 22:31   Re: End Round Sound
Reply With Quote #3

How can that solve the problem ?
Gh05t04 is offline
Vancold
Member
Join Date: Jan 2015
Old 08-19-2015 , 11:13   Re: End Round Sound
Reply With Quote #4

Please post your compiling errors.
Vancold is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-19-2015 , 13:52   Re: End Round Sound
Reply With Quote #5

Just remove this code because its pointless.

Code:
public LogEvent_RoundEnd() 
{     
    for( new i = 1 ; i<=get_maxplayers();++ i) 
    { 
        if( is_user_connected(i)) 
        TocarMusica(); 
    } 
}
and change this
Code:
register_logevent( "LogEvent_RoundEnd",     2, "1=Round_End"     );
->

Code:
register_logevent( "TocarMusica",     2, "1=Round_End"     );


And you are using a shit ton of unnecessary includes that you can remove.
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 08-19-2015 at 13:54.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-19-2015 , 16:00   Re: End Round Sound
Reply With Quote #6

Btw can I change the knife model when the music starts playing?
Gh05t04 is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-19-2015 , 17:35   Re: End Round Sound
Reply With Quote #7

So now It fixed the messages, but it wont play the songs!

PHP Code:
#include <amxmodx>
#include <ColorChat> 

#define PLUGIN "Musicas"  
#define VERSION "1.0"  
#define AUTHOR "Gh05t"  

new musica_1[]     = "sound/[frenzy]JailBreak/Musicas/1.mp3" 
new musica_2[]     = "sound/[frenzy]JailBreak/Musicas/2.mp3" 
new musica_3[]     = "sound/[frenzy]JailBreak/Musicas/3.mp3" 
new musica_4[]     = "sound/[frenzy]JailBreak/Musicas/4.mp3" 
new musica_5[]     = "sound/[frenzy]JailBreak/Musicas/5.mp3" 
new musica_6[]     = "sound/[frenzy]JailBreak/Musicas/6.mp3" 
new musica_7[]     = "sound/[frenzy]JailBreak/Musicas/7.mp3" 
new musica_8[]     = "sound/[frenzy]JailBreak/Musicas/8.mp3" 
new musica_9[]     = "sound/[frenzy]JailBreak/Musicas/9.mp3" 
new musica_10[]    = "sound/[frenzy]JailBreak/Musicas/10.mp3" 

public plugin_precache() 

    
precache_generic(musica_1); 
    
precache_generic(musica_2); 
    
precache_generic(musica_3); 
    
precache_generic(musica_4); 
    
precache_generic(musica_5); 
    
precache_generic(musica_6); 
    
precache_generic(musica_7); 
    
precache_generic(musica_8); 
    
precache_generic(musica_9); 
    
precache_generic(musica_10); 


public 
plugin_init()  
{  
    
register_plugin(PLUGINVERSIONAUTHOR)  
    
    
register_logevent"play_music",     2"1=Round_End"     );
}  

public 
play_music()
{
  new 
rand random_num(0,9)

  switch(
rand)
  {
        case 
0:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_1); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Nils Van Zandt ft. Brooklyn Haley - For You"
            } 
        }  
        case 
1:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_2); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Tungevaag & Raaban - Parade"
            } 
        }  
        case 
2:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_3); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3ItaloBrothers & Floorfilla ft. P. Moody - One Heart"
            } 
        } 
        case 
3:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_4); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Redfoo - New Thang"
            } 
        } 
        case 
4:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_5); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Afrojack - Ten Feet Tall ft. Wrabel "
            } 
        } 
        case 
5:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_6); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Bassjackers, Afrojack - What We Live For"
            } 
        } 
        case 
6:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_7); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Grits - My Life Be Like"
            } 
        } 
        case 
7:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_8); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3David Guetta - Lovers On The Sun ft. Sam Martin "
            } 
        } 
        case 
8:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_9); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Skrillex & Damian Marley - Make It Bun Dem"
            } 
        } 
        case 
9:  
        {  
            
client_cmd(0"mp3 play ^"%s^""musica_10); 
            { 
                
ColorChat(0GREEN"[frenzy] ^1Esta a tocar: ^3Eminem - Rap God"
            } 
        } 
  }

  return 
PLUGIN_HANDLED

Gh05t04 is offline
Reply



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 03:31.


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