Code:
#include <amxmodx>
#include <engine>
#include <amxmisc>
public plugin_init()
{
register_plugin("Surf Patrol","3.0","Anthrax")
register_cvar("surf_slayer_enable","1")
register_event("Damage","killer_event","b","2!0")
}
public killer_event(id)
{
if(!get_cvar_num("surf_slayer_enable"))
{
return PLUGIN_CONTINUE
}
new weapon, attacker = get_user_attacker(id, weapon)
if(!is_user_connected(attacker) || !is_user_alive(attacker))
{
return PLUGIN_CONTINUE
}
new attackerName[33]
new victimName[33]
get_user_name(attacker, attackerName, 32)
get_user_name(id, victimName, 32)
if( weapon == CSW_SCOUT || weapon == CSW_KNIFE )
{
user_kill(attacker,0)
client_print(attacker,print_chat,"You Were Slayed For Attempting To Kill")
set_hudmessage(0, 100, 200, 0.75, 0.50, 2, 0.1, 4.0, 0.02, 0.02, 9)
new str[201]
format(str , 200 , "%s was slayed for attacking %s", attackerName, victimName);
show_hudmessage(0, str)
return PLUGIN_CONTINUE
}
client_print(0,print_chat,"%s",weapon)
return PLUGIN_CONTINUE
}