Even if the killer wasn't the victim, when a grenade is thrown the player (killer) switches back to a primary or secondary by the time the grenade explodes and potentially kills someone. You cannot use get_user_weapon() on the thrower of a grenade.
PHP Code:
#include <amxmodx>
#include <cstrike>
public plugin_init()
{
register_event( "DeathMsg" , "DeathMsg" , "a" , "4=grenade" , "1>0" );
}
public DeathMsg()
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
if ( iKiller == iVictim )
{
new szName[ 32 ];
get_user_name( iVictim , szName , charsmax( szName ) );
client_print( 0 , print_chat , "%s killed by grenade" , szName );
}
}
__________________