PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < colorchat >
public plugin_init( )
{
register_clcmd( "+adminslay", "slay_by_aim", ADMIN_BAN );
}
public slay_by_aim( id )
{
new player, body;
new admin_name[ 32 ], user_name[ 32 ];
if( get_user_flags( id ) & ADMIN_BAN )
{
get_user_aiming( id, player, body );
if( get_user_flags( player ) & ADMIN_IMMUNITY )
{
ColorChat( id, GREEN, "You can slay a player with Immunity!" );
return PLUGIN_HANDLED;
}
else
{
if( is_user_alive( player ) )
{
get_user_name( id, admin_name, 31 ), get_user_name( player, user_name, 31 );
user_kill( player );
ColorChat( player, GREY, "You have been slayed by %s", admin_name );
ColorChat( id, TEAM_COLOR, "You just slayed %s", user_name );
}
}
}
return PLUGIN_HANDLED;
}
By the way in your code you forgot "#include < colorchat >" ..