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 , 21:01   Re: [HELP] Background music on HLDS
Reply With Quote #1

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 #2

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 #3

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
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