Raised This Month: $ Target: $400
 0% 

Background Music for CS and Cz (*.mp3)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 03-12-2009 , 04:23   Background Music for CS and Cz (*.mp3)
Reply With Quote #1

How to make background music when round start?

PHP Code:
#include <amxmodx>
//Thanks to tuty for helping me ^_^

//Sound Path
#define SND1 "anime/battle/into_the_battlefiled.mp3"

new g_Count 0;

public 
plugin_init()
{
    
register_plugin("Battle Sound""1.0""ilham92-cc-sakura");
    
register_event("TextMsg""GameCommencing""a""2=#Game_Commencing");
    
register_logevent("roundstart"2"1=Round_Start");
}
public 
plugin_precache()
{
    
precache_sound(SND1);
}
public 
GameCommencing()
{
    
g_Count 0;
}
public 
roundstart()
{
    
g_Count++;
    
    
set_hudmessage(02550, -1.00.3006.08.0);
    
show_hudmessage(0"Prepare for Battle! Go For it!^nRound %i"g_Count);

    new 
sound1[129];
    
copy(sound1,128,SND1);

    if(
contain(sound1,".mp3"))
    {
        
replace(sound1,128,".mp3","");
        
client_cmd(0"mp3 play %s",sound1);
    }

i have try this, but mp3 not play... how to fix? i have mistake code?
Music: Download (© by me, my friend studio)
__________________
ilham92-cc-sakura is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-12-2009 , 04:46   Re: Background Music for CS and Cz (*.mp3)
Reply With Quote #2

precache_sound to precache_generic .. i think this is the problem..
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2009 , 04:48   Re: Background Music for CS and Cz (*.mp3)
Reply With Quote #3

You need to provide "sound/" in the path for mp3. Also, you should use precache_genereic()
Arkshine is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 03-12-2009 , 05:20   Re: Background Music for CS and Cz (*.mp3)
Reply With Quote #4

not work...
precache_genereic (SND1);
and
#define SND1 "sound/anime/battle/into_the_battlefiled.mp3"
__________________
ilham92-cc-sakura is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-12-2009 , 05:33   Re: Background Music for CS and Cz (*.mp3)
Reply With Quote #5

Try this here :


PHP Code:
#include <amxmodx>
//Thanks to tuty for helping me ^_^

//Sound Path
#define SND1 "sound/anime/battle/into_the_battlefiled.mp3"

new g_Count 0;

public 
plugin_init()
{
    
register_plugin("Battle Sound""1.0""ilham92-cc-sakura");
    
register_event("TextMsg""GameCommencing""a""2=#Game_Commencing");
    
register_logevent("roundstart"2"1=Round_Start");
}
public 
plugin_precache()
{
    
precache_generic(SND1);
}
public 
GameCommencing()
{
    
g_Count 0;
}
public 
roundstart()
{
    
g_Count++;
    
    
set_hudmessage(02550, -1.00.3006.08.0);
    
show_hudmessage(0"Prepare for Battle! Go For it!^nRound %i"g_Count);

    new 
sound1[129];
    
copy(sound1,128,SND1);

    if(
contain(sound1,".mp3"))
    {
        
replace(sound1,128,".mp3","");
        
client_cmd(0"mp3 play %s",sound1);
    }
   } 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 09:03.


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