Raised This Month: $ Target: $400
 0% 

Play a sound when player dies


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xnn
Junior Member
Join Date: Jun 2006
Old 06-20-2006 , 10:52   Play a sound when player dies
Reply With Quote #1

Hi there. As you can see, I'm new around here. Just started to learn a little about AMXX and I want to make a plugin for a friend of mine. Here we go.

What I want is this: play a sound when player with the name "x" dies...it sounds fairly easy, but I can't get it working Any help would be appreciated. Here's what I've done so far:

Code:
#include <amxmodx>

new PLUGIN[]="kenny's death"
new AUTHOR[]="xenon"
new VERSION[]="1.0"

public plugin_init() {
    register_plugin(PLUGIN,AUTHOR,VERSION)
    register_event("DeathMsg", "k_die", "a")
}

public k_die() {
   new victim = read_data(2)
   new player[] = "kenny"
   if(get_user_name(victim,player,5)) {
	client_cmd(0,"stopsound")
	client_cmd(0,"spk misc/kenny1")
   }
   return PLUGIN_HANDLED
}

public plugin_precache()
{
  precache_sound("misc/kenny1.wav")
 
  return PLUGIN_CONTINUE
}
I did something. But, when ANY player dies, I hear that sound. It's the opposite of what I want. I need that all players hear the sound when I die.
xnn is offline
 



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 08:04.


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