Replace rg_get_weaponbox_id(pevAttacker) with get_user_weapon(pevAttacker).
You should probably hook DeathMsg instead, because it may happen that the victim dies to a grenade while the attacker is holding a knife.
Quote:
Originally Posted by Bugsy
I've never scripted or know anything about WC3. Do some testing for yourself to see what happens in the DeathMsg event.
DeathMsg
PHP Code:
register_event( "DeathMsg" , "DeathMsgEvent" , "a" );
public DeathMsgEvent() { new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); new iIsHeadshot = read_data( 3 ); new szWeapon[ 20 ]; read_data( 4 , szWeapon , charsmax( szWeapon ) ); client_print( 0 , print_chat , "%d %d %d %s" , iKiller , iVictim , iIsHeadshot , szWeapon ); }
|
__________________