Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
new g_msgDeath, g_msgSay
new g_iFrags[ 33 ]
new g_szName[ 33 ][ 32 ], g_szWeapon[ 33 ][ 11 ]
public plugin_init()
{
register_plugin( "DeathMSG Frags", "1.0", "amxx" )
g_msgDeath = get_user_msgid( "DeathMsg" )
g_msgSay = get_user_msgid( "SayText" )
register_message( g_msgDeath, "event_dmg" )
register_message( g_msgSay, "event_saytxt" ) //prevent chat spam of changing nicks
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
}
public client_putinserver( id )
{
g_iFrags[ id ] = 0
g_szWeapon[ id ][ 0 ] = EOS
get_user_name( id, g_szName[ id ], charsmax( g_szName ) )
}
public event_saytxt( msg_id, msg_dest, msg_entity )
{
new arg[ 32 ]
get_msg_arg_string( 2, arg, charsmax( arg ) )
if( equal( arg, "#Cstrike_Name_Change" ) )
return PLUGIN_HANDLED //prevent chat spam of changing nicks
return PLUGIN_CONTINUE
}
public event_dmg()
{
new data[ 4 ]
data[ 0 ] = get_msg_arg_int( 1 ) //credits to Bugsy
data[ 1 ] = get_msg_arg_int( 2 )
data[ 2 ] = get_msg_arg_int( 3 )
get_msg_arg_string( 4 , g_szWeapon[ data[ 0 ] ], charsmax( g_szWeapon[] ) ) //not so smart part here, but i think it will work properly with set_task
if( data[ 0 ] == data[ 1 ] )
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}