Not thoroughly tested
PHP Code:
#include <amxmodx>
#include <hamsandwich>
new g_iPlayerHasC4;
public plugin_init()
{
RegisterHam( Ham_Killed , "player" , "HamPlayerKilled" );
register_logevent( "LostBomb" , 3 , "2=Dropped_The_Bomb" );
register_logevent( "GotBomb" , 3 , "2=Got_The_Bomb" );
register_event( "WeapPickup" , "GotBomb2" , "be" , "1=6" );
}
public GotBomb()
{
g_iPlayerHasC4 = get_loguser_index();
}
public GotBomb2( id )
{
g_iPlayerHasC4 = id;
}
public LostBomb()
{
if ( is_user_alive( get_loguser_index() ) )
{
g_iPlayerHasC4 = 0;
}
}
public HamPlayerKilled( iVictim , iAttacker )
{
if ( g_iPlayerHasC4 && ( iVictim == g_iPlayerHasC4 ) )
{
new szCarrierName[32];
get_user_name( iVictim , szCarrierName , charsmax( szCarrierName ) );
client_print( iAttacker , print_chat, "You just killed a c4 carrier guy (%s)" , szCarrierName );
}
}
get_loguser_index()
{
new loguser[80], name[32]
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
return get_user_index(name)
}
__________________