Raised This Month: $ Target: $400
 0% 

[HELP] Background music on HLDS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 12:19   [HELP] Background music on HLDS
Reply With Quote #1

can any 1 tell me how to play any music on background in my HLDS when players were playing CS..
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
m4m3ts
Senior Member
Join Date: Jun 2012
Old 11-06-2013 , 18:36   Re: [HELP] Background music on HLDS
Reply With Quote #2

Quote:
Originally Posted by m.touqeerafzal View Post
can any 1 tell me how to play any music on background in my HLDS when players were playing CS..
put your music file on CS folder
Counter-Strike 1.6\cstrike\sound\ambience\ (put in here)
you only can play .wav format.

then play cs, open console, type this
spk ambience/yourMusictitle
hit enter.

type stopsound to stop music.
that's for 1 player only.

this for all player.
only admin can execute this.

PHP Code:
#include <amxmodx>

public plugin_precache()
{
    
precache_sound("ambience/yourMusictitle.wav")
}

public 
plugin_init()
{
    
register_plugin"playMusic""1.0""m4m3ts" )

    
register_clcmd("say /play""playmusic"ADMIN_BAN)
    
register_clcmd("say /stop""stopmusic"ADMIN_BAN)
}

public 
playmusic(id)
{
    
client_cmd0"yourMusictitle")
}

public 
stopmusic(id)
{
    
client_cmd0"stopsound")


Last edited by m4m3ts; 11-06-2013 at 18:43.
m4m3ts is offline
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 21:01   Re: [HELP] Background music on HLDS
Reply With Quote #3

Thanx buddy..

It was really helpful... but i want to correct you,

//This code does'nt work
public playmusic(id)
{
client_cmd( 0, "yourMusictitle")
}

//Then I tried this, and it works really awesome
public playmusic(id)
{
client_cmd( 0, "spk ambience/yourMusictitle")
}


Really thanx buddy (Y) (Y)
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
m4m3ts
Senior Member
Join Date: Jun 2012
Old 11-06-2013 , 22:47   Re: [HELP] Background music on HLDS
Reply With Quote #4

Quote:
Originally Posted by m.touqeerafzal View Post
client_cmd( 0, "spk ambience/yourMusictitle")
that's what i mean...
i don't know to loop music..
m4m3ts is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 11-07-2013 , 12:26   Re: [HELP] Background music on HLDS
Reply With Quote #5

PHP Code:
#include <amxmodx>

#define MUSICTIME 180.0 // Write the Song time in seconds here

public plugin_precache()
{
    
precache_sound("ambience/yourMusictitle.wav")
}

public 
plugin_init()
{
    
register_plugin"playMusic""1.0""m4m3ts" )
    
    
register_clcmd("say /play""playmusic"ADMIN_BAN)
    
register_clcmd("say /stop""stopmusic"ADMIN_BAN)
}

public 
playmusic(id)
{
    
remove_task()
    
client_cmd0"spk ambience/yourMusictitle.wav")
    
set_task(MUSICTIME"playmusic")
}

public 
stopmusic(id)
{
    
client_cmd0"stopsound")
    
remove_task()

__________________
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.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
m.touqeerafzal
Member
Join Date: May 2013
Old 11-06-2013 , 21:32   Re: [HELP] Background music on HLDS
Reply With Quote #6

Using this code... music is only played once... but i want to play that music on repeat what should i do??? plzz help....
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
m.touqeerafzal
Member
Join Date: May 2013
Old 11-07-2013 , 13:27   Re: [HELP] Background music on HLDS
Reply With Quote #7

thanx buddy it is helpful...
m.touqeerafzal is offline
Send a message via Skype™ to m.touqeerafzal
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:16.


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