Code: Select all
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#define ADMIN_FLAG ADMIN_KICK
public plugin_init()
{
register_plugin("Breakable","1.0","Raheem")
RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
}
public FwdHamBreakableKilled(ent, weapon, killer)
{
if(entity_get_float(ent,EV_FL_health)<0)
{
static name[ 32 ];
get_user_name( killer, name, charsmax( name ) );
for (new i = 0; i < get_maxplayers(); i++)
{
if (is_user_connected(i) && get_user_flags(i) & ADMIN_FLAG)
{
print_colored( i, "!y[!gZE!y] BREAKABLE DESTROYED BY: (!g%s!y)", name );
}
}
return(HAM_IGNORED);
}
return(HAM_IGNORED);
}
/* Color Stocks */
stock print_colored( const id, const input[], any: ... )
{
new count = 1, players[32], i, player;
static msg[191];
if ( numargs() == 2 )
copy( msg, 190, input );
else
vformat( msg, 190, input, 3 );
replace_all( msg, 190, "!g", "^4" );
replace_all( msg, 190, "!y", "^1" );
replace_all( msg, 190, "!t", "^3" );
if ( id )
{
if ( !is_user_connected( id ) ) return;
players[0] = id;
} else get_players( players, count, "ch" );
for ( i = 0; i < count; i++ )
{
player = players[i];
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, player );
write_byte( player );
write_string( msg );
message_end();
}
}