PDA

View Full Version : Killing sound !


mahdi
12-26-2016, 11:18
Hi i need plugin killing sound if player killing other player sound is play not public just killer can be Listening ! i found this https://forums.alliedmods.net/showthread.php?t=66006 (http://forums.alliedmods.net/showthread.php?t=66006)

but on this if player kill its public and other player can be Listening !

look to this video http://www.youtube.com/watch?v=JzTE9OjHUXE

if can pleas use this sound !

EFFx
12-26-2016, 11:30
On ultimate_sounds.sma ->


announce(killer, level)
{
new streak = get_streak()

if (streak&1)
{
new name[32];

get_user_name(killer, name, 32);
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
ShowSyncHudMsg(0, gmsgHudSync, stkmessages[level], name);
}

if (streak&2){
for(new i=1;i<=get_maxplayers();i++)
if(is_user_connected(i)==1 )
client_cmd(i, "spk %s", stksounds[level]);
}
}

->


announce(killer, level)
{
new streak = get_streak()

if (streak&1)
{
new name[32];

get_user_name(killer, name, 32);
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
ShowSyncHudMsg(killer, gmsgHudSync, stkmessages[level], name);
}

if (streak&2)
{
client_cmd(killer, "spk %s", stksounds[level]);
}
}

mahdi
12-26-2016, 11:36
i need just 1 kill so how ? and dont need hud massage !

EFFx
12-26-2016, 12:22
One kill? Like the video? Something like that?


#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("DeathMsg","DeathMessage","a")
}
public DeathMessage()
{
new iKiller = read_data(1)
new iVictim = read_data(2)

if((iKiller != iVictim) || (get_user_team(iKiller) != get_user_team(iVictim)))
{
client_cmd(iKiller,"spk buttons/bell1")
}
}

mahdi
12-26-2016, 19:26
yes 1 kill sound and yes like video !

mahdi
12-26-2016, 19:47
work %100 Thanks somach !

EFFx
12-26-2016, 20:32
If you want the feature that says "You're dominating X" :


#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const sound_humiliation[] = "sound/humiliation.wav"

const TASK_SOUND = 20120131

new szHumiliation[33][33]
new szVictimName[32]

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("DeathMsg","DeathMessage","a")
}
public plugin_precache()
{
precache_sound(sound_humiliation)
}
public DeathMessage()
{
new iKiller = read_data(1)
new iVictim = read_data(2)

if((iKiller != iVictim) || (get_user_team(iKiller) != get_user_team(iVictim)))
{
szHumiliation[iKiller][iVictim]++

if(szHumiliation[iVictim][iKiller] > 0)
szHumiliation[iVictim][iKiller] = 0

client_cmd(iKiller,"spk buttons/bell1")

if(szHumiliation[iKiller][iVictim] >= 3)
{
get_user_name(iVictim,szVictimName,charsmax(s zVictimName))

set_task(2.0,"SoundHumiliation",iKiller+TASK_SOUND)
}
}
}
public SoundHumiliation(index)
{
new id = index - TASK_SOUND

client_cmd(id,"spk ^"%s^"",sound_humiliation)
client_print(id,print_chat,"You're now dominating %s",szVictimName)
}


Here:


new const sound_humiliation[] = "sound/humiliation.wav"

Thats your custom sound, install what sound you want to be listen when you're dominating someone.