I wants in order to all near (about) it victims or attackers listens sounds tk and ta.
PHP Code:
#include <amxmodx>
#include <amxmisc>
new const PLUGIN[] = "Ta and tk sounds"
new const VERSION[] = "1.0"
new const AUTHOR[] = "sQn"
new const g_teamattack_sounds[][] =
{
"tk_1.wav",
"tk_2.wav",
"tk_3.wav",
"tk_4.wav"
}
new const g_teamkill_sounds[][] =
{
"taunt_1.wav",
"taunt_2.wav",
"taunt_3.wav",
"taunt_4.wav",
"taunt_5.wav"
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Damage", "damage_event", "b", "2>10")
}
public plugin_precache()
{
precache_sound( "FtF/tk_1.wav" )
precache_sound( "FtF/tk_2.wav" )
precache_sound( "FtF/tk_3.wav" )
precache_sound( "FtF/tk_4.wav" )
precache_sound( "FtF/taunt_1.wav" )
precache_sound( "FtF/taunt_2.wav" )
precache_sound( "FtF/taunt_3.wav" )
precache_sound( "FtF/taunt_4.wav" )
precache_sound( "FtF/taunt_5.wav" )
}
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
{
if(TA)
{
emit_sound(victim, CHAN_VOICE, g_teamattack_sounds[random_num(0, sizeof g_teamattack_sounds - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
public damage_event( victim ) {
new damage = read_data(2)
new weapon, hitplace
new attacker = get_user_attacker(victim,weapon,hitplace)
return PLUGIN_CONTINUE
//TK
else if (get_user_health(victim) <= 0 &&(get_user_team(victim) == get_user_team(attacker)) {
if (getrandom() >= 1 && getrandom() <= 80) {
client_cmd(attacker,"spk FtF/pl/tk_1.wav")
client_cmd(victim,"spk FtF/pl/taunt_1.wav")
}
if (getrandom() >= 1 && getrandom() <= 80) {
client_cmd(attacker,"spk FtF/pl/tk_2.wav")
client_cmd(victim,"spk FtF/pl/taunt_2.wav")
}
if (getrandom() >= 1 && getrandom() <= 80) {
client_cmd(attacker,"spk FtF/pl/tk_3.wav")
client_cmd(victim,"spk FtF/pl/taunt_3.wav")
}
else {
return PLUGIN_CONTINUE
}
}
__________________