Raised This Month: $ Target: $400
 0% 

Sound after a kill


Post New Thread Reply   
 
Thread Tools Display Modes
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 04-13-2006 , 18:17  
Reply With Quote #21

Quote:
Originally Posted by DoXe
Thx Vittu, its works great, but the sound does play even if i kill some one whid a gun... :/
That's cause your not checking if it's a knife...

Gorlag/Batman already told you:
Quote:
Originally Posted by Gorlag/Batman
Read the fourth parameter in the death event, that'll tell you what weapon it is.
An easy way to do this is to only call the function of the death event when a knife is used when registering the event, like so:
Code:
register_event("DeathMsg", "death_event", "a", "4&knife")
Setting the condition "4&knife" means the 4th parameter of message must contain "knife" substring or the function will not be called.


Also, since you are playing the sound on the guy who dies you should make sure he is at least connected. And you may want to check if the person that kills the user actually has the hero.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 04-26-2006 , 12:59  
Reply With Quote #22

Thx vittu, and yes i want to do that, so how i do it?

***OFF TOPIC*** By the way, how do i make 'some_one wrote' ??
DoXe is offline
D o o m
Veteran Member
Join Date: Sep 2005
Location: Germany
Old 04-26-2006 , 13:05  
Reply With Quote #23

Answer for your OFF TOPIC question:

Write
Code:
[quote="NICK"]TEXT[/quote]
Just insert the name, who wrote it and the text or if you wanna make that with a whole post, just click on quote at the right upper side of every post (matters which post you wanna have) ;)
__________________
Heroes
:+: Deadpool :+:
D o o m is offline
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 04-26-2006 , 13:06  
Reply With Quote #24

Ok, Thx Doom.
DoXe is offline
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 04-28-2006 , 15:42  
Reply With Quote #25

Quote:
Originally Posted by vittu
Also, since you are playing the sound on the guy who dies you should make sure he is at least connected. And you may want to check if the person that kills the user actually has the hero.
Can some one tell me how to do that?
DoXe is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 04-28-2006 , 18:05  
Reply With Quote #26

Code:
public death_event()
{ 
new killer = read_data(1)  //Gets the attacker
new victim = read_data(2) //gets u the person that dies ID. 

//This line will get called if the victim is connected and the attacker has the power
if(is_user_connected(victim) && gHasHeroPowers[killer]) emit_sound(victim, shmod/jtr_kill.wav)
// this will emit sound from the person depend on what option you set to. 

}
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
DoXe
Junior Member
Join Date: Aug 2005
Location: Sweden!
Old 04-29-2006 , 22:22  
Reply With Quote #27

Ok, Thx Gorlag/Batman
DoXe 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 11:21.


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