Raised This Month: $ Target: $400
 0% 

Need Small Fix !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jawad abatorab
Member
Join Date: Jun 2014
Old 09-02-2014 , 07:42   Need Small Fix !
Reply With Quote #1

I want this Plugin to play music mp3 not wav and thnx

PHP Code:
  #include <amxmisc>

    
new g_szSounds[][] = 
    {
        
"misc/sound.wav",
        
"misc/sound2.wav"
    
}
    
    public 
plugin_precache() 
    {
        for ( new 
isizeof g_szSoundsi++ )
        {
            
precache_soundg_szSounds] );
        }
    }

    public 
plugin_init()
    {
        
register_plugin"Prepare to fight MSG""0.1""P.Of.Pw" );
        
register_logevent"roundstart"2"1=Round_Start" );
    }

    public 
roundstart () 
    {
        
client_cmd0"spk %s"g_szSoundsrandom_num0sizeof g_szSounds ) ] );
    } 
jawad abatorab is offline
Send a message via Skype™ to jawad abatorab
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 09-02-2014 , 07:53   Re: Need Small Fix !
Reply With Quote #2

PHP Code:
#include <amxmisc>

new const g_szSounds[][] =  

    
"sound/misc/sound.mp3",
    
"sound/misc/sound2.mp3"


public 
plugin_precache()

    for (new 
isizeof g_szSoundsi++)
    { 
        
precache_sound(g_szSounds[i])
    } 


public 
plugin_init() 
{
    
register_plugin("Prepare to fight MSG""0.1""P.Of.Pw")
    
register_logevent("roundstart"2"1=Round_Start")
}

public 
roundstart ()
{
    
client_cmd(0"mp3 play %s"g_szSounds[random(sizeof g_szSounds)])

__________________

Last edited by Flick3rR; 09-02-2014 at 08:27.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
jawad abatorab
Member
Join Date: Jun 2014
Old 09-02-2014 , 07:56   Re: Need Small Fix !
Reply With Quote #3

music doesn't play !!

Last edited by jawad abatorab; 09-02-2014 at 08:12.
jawad abatorab is offline
Send a message via Skype™ to jawad abatorab
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 09-02-2014 , 08:20   Re: Need Small Fix !
Reply With Quote #4

Quote:
Originally Posted by jawad abatorab View Post
music doesn't play !!
PHP Code:
new const g_szSounds[][] =  

    
"sound/misc/sound.mp3",
    
"sound/misc/sound2.mp3"

__________________
Eagle07 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 09-02-2014 , 08:27   Re: Need Small Fix !
Reply With Quote #5

Quote:
Originally Posted by Eagle07 View Post
PHP Code:
new const g_szSounds[][] =  

    
"sound/misc/sound.mp3",
    
"sound/misc/sound2.mp3"

That's right, forgot to add it.
Check the edited code above.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 09-02-2014 , 09:22   Re: Need Small Fix !
Reply With Quote #6

Quote:
Originally Posted by Flick3rR View Post
That's right, forgot to add it.
Check the edited code above.
But in precache_sound You don't need to add "sound/..." ?
__________________
Eagle07 is offline
Old 09-02-2014, 10:43
Fuck For Fun
This message has been deleted by Fuck For Fun. Reason: wrong message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-02-2014 , 15:50   Re: Need Small Fix !
Reply With Quote #7

I think you need precache_generic for mp3, don't you?
__________________
Kia is offline
Mirk
Senior Member
Join Date: Nov 2012
Old 09-02-2014 , 16:32   Re: Need Small Fix !
Reply With Quote #8

Try to use get_players and Kia of post...
Mirk 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 23:46.


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