Raised This Month: $ Target: $400
 0% 

How to add sound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 05-08-2010 , 11:17   How to add sound?
Reply With Quote #1

hi, i have a question. How can i add sound, when player uses a chat command. For example: he says: /shout, and then everybody hears shouting sound comming from him. Sound should be heard not just by the player who used the command, and other should hear if close enought (not same voice)
eNz0 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 05-08-2010 , 15:18   Re: How to add sound?
Reply With Quote #2

You can use
PHP Code:
public plugin_init()
register_clcmd("say /shoot""cmdSound")

public 
cmdSound(id
client_cmd(0"spk weapons/deagle-1.wav"
deagle-1.wav is the shoot's sound of deagle weapon (it's an example). You can change the sound.
NOTE: The initial (or directory) folder is "sound".
If you want to put a sound that is on sound/yourfolder you have to code:
PHP Code:
client_cmd(0"spk yourfolder/yoursound.wav"

Last edited by Mxnn; 05-08-2010 at 15:22.
Mxnn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2010 , 16:27   Re: How to add sound?
Reply With Quote #3

Code:
emit_sound()
__________________
fysiks is offline
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 05-09-2010 , 03:37   Re: How to add sound?
Reply With Quote #4

if i use:
PHP Code:
emit_sound(0,.....) 
doesn't "0" means that sound will be heard by everybody, with the same voice?

should i use "id" then?

PHP Code:
client_cmd(0"spk yourfolder/yoursound.wav"


is "spk" command heard by everyone? (not the same voice)

I need all this stuff for leap plugin. When player does leap, he shouts.
eNz0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2010 , 14:23   Re: How to add sound?
Reply With Quote #5

Quote:
Originally Posted by eNz0 View Post
if i use:
PHP Code:
emit_sound(0,.....) 
doesn't "0" means that sound will be heard by everybody, with the same voice?

should i use "id" then?

PHP Code:
client_cmd(0"spk yourfolder/yoursound.wav"
is "spk" command heard by everyone? (not the same voice)

I need all this stuff for leap plugin. When player does leap, he shouts.
You would use emit_sound(12, . . .). This will emit the sound from the player in slot 12. Only people close enough to player 12 will be able to hear it.
__________________
fysiks is offline
eNz0
Member
Join Date: Feb 2010
Location: Lithuania
Old 05-11-2010 , 10:24   Re: How to add sound?
Reply With Quote #6

Thanks
eNz0 is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 05-09-2010 , 13:15   Re: How to add sound?
Reply With Quote #7

"spk(speak) [sound]" command plays the sound that you want.
The sound is the same volume to everyone.
Mxnn is offline
Reply


Thread Tools
Display Modes

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:52.


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