Raised This Month: $ Target: $400
 0% 

Hero whid Sound...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 02-14-2006 , 14:11   Hero whid Sound...
Reply With Quote #1

Ok..Ive look for this but i dident find it..
I want a smal sound on my hero...when i use the power of my hero i want a sound to play..
An example: Like when i use Bass i want a sound to play for each laser shot.
__________________
I might be working on something intressting..
DoXe is offline
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 02-14-2006 , 15:27  
Reply With Quote #2

what kind of sound?
notorious-sk8er is offline
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 02-15-2006 , 09:34  
Reply With Quote #3

just a short voice...i have it on MP3, wma and wav..
__________________
I might be working on something intressting..
DoXe is offline
notorious-sk8er
Senior Member
Join Date: Jun 2005
Old 02-15-2006 , 14:13  
Reply With Quote #4

if you have it then why do you need help
notorious-sk8er is offline
K-OS
Senior Member
Join Date: Jan 2006
Location: Netherlands
Old 02-15-2006 , 14:38  
Reply With Quote #5

I think he needs help with coding the sound into the heros.
__________________

This is my BOOMSTICK!!
K-OS is offline
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 02-15-2006 , 15:59  
Reply With Quote #6

Yep, K-OS, thats what i need help whid. Can u help me whid that?
__________________
I might be working on something intressting..
DoXe is offline
K-OS
Senior Member
Join Date: Jan 2006
Location: Netherlands
Old 02-15-2006 , 18:58  
Reply With Quote #7

okay....

First precache your sound, if you don't do this your server may crash.
( Use the wav file )

Code:
public plugin_precache() {
	precache_sound("your_sound.wav")
}
Now that the sound is precache, you can use the sound anywhere you want.
There are 2 types of sound:
- Emitted sound; The player and everyone near him wil hear the sound.
- And the euh... sound that is not emitted; Only the player wil hear the sound.

Code:
// Emitted sound
emit_sound(PlayerID, CHAN_AUTO, "your_sound.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

// Not emitted sound
client_cmd(PlayerID,"spk your_sound.wav")
If the PlayerID is 0, the sound will be broadcasted to everyone.
With the emit_sound function you can change some params that change how the sound is handled, but these params will do just fine for now.

Good luck.
__________________

This is my BOOMSTICK!!
K-OS is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 02-16-2006 , 15:36  
Reply With Quote #8

u can also replace the sound, using fakemeta function

register_forward(FM_EmitSound, "emitsound")

then find the correct sound it plays when u shoot, and replace that sound. i believe that could work ja then this way u don't hear two sounds.
__________________
yang is offline
Send a message via AIM to yang
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 02-25-2006 , 16:09  
Reply With Quote #9

ok, thx ;)
__________________
I might be working on something intressting..
DoXe is offline
PsychoStand
Member
Join Date: Apr 2006
Old 05-09-2006 , 08:41  
Reply With Quote #10

How do i add it to a weapon
PsychoStand 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 17:08.


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