AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   play sound on player death (https://forums.alliedmods.net/showthread.php?t=75848)

redboyke 08-13-2008 12:05

play sound on player death
 
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

Arkshine 08-13-2008 12:11

Re: play sound on player death
 
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'.

redboyke 08-13-2008 13:57

Re: play sound on player death
 
thx i will try


All times are GMT -4. The time now is 03:07.

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