View Single Post
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 10-10-2014 , 02:33   Re: When someone get kill by knife . Play a troll sound
Reply With Quote #9

Hamsandwich method:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

//#define USE_NEW_AMX_183
#define SoundTroll "misc/trollsound.wav"

public plugin_precache()
{
    
precache_sound(SoundTroll)
}

public 
plugin_init()
{
    
register_plugin("Knife Kill Vox""0.0.1""wbyokomo")
    
    
#if defined USE_NEW_AMX_183
    
RegisterHam(Ham_Killed"player""OnPlayerKilled"0true//CSBot support
    #else
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
#endif
}

public 
OnPlayerKilled(victimattacker)
{
    if(!
is_user_connected(attacker)) return;
    if(
get_user_weapon(attacker) != CSW_KNIFE) return;
    
    
client_cmd(victim"spk %s"SoundTroll)

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline