Raised This Month: $ Target: $400
 0% 

play sound on player death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redboyke
Member
Join Date: May 2008
Old 08-13-2008 , 12:05   play sound on player death
Reply With Quote #1

i want to play a sound when players dies how do i check this?

public song(id) {
new CsTeams:team
team = cs_get_user_team(id)

if ((team==CS_TEAM_SPECTATOR)||(team==CS_TEAM_UN ASSIGNED)||(team==CS_TEAM_T)||(team==CS_TEAM_ CT))
{
if (playing[id]==false)
{
new params[1]
params[0]=id
set_task(0.5,"play_song_task",0,params,1,"a", 1)
playing[id]=true
}
}
else
{
client_cmd(id,"mp3 stop")
playing[id]=false
redboyke is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-13-2008 , 12:11   Re: play sound on player death
Reply With Quote #2

Should work.

Code:
    #include <amxmodx>         new const gs_Sound[] = "sound/mysound.mp3";         public plugin_init ()     {         register_event ( "DeathMsg", "Event_DeathMsg", "a" );     }         public Event_DeathMsg ()     {         client_cmd ( read_data( 2 ), "mp3 play %s", gs_Sound );     }

If the sound is a .wav change "mp3 play" by "play" or "spk", and remove "sound/" in 'gs_Sound'.
__________________
Arkshine is offline
redboyke
Member
Join Date: May 2008
Old 08-13-2008 , 13:57   Re: play sound on player death
Reply With Quote #3

thx i will try
redboyke 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 03:07.


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