
#include <amxmod>

new KnifeEnabled 

public amx_enableknife(id) {
	if (!(get_user_flags(id)&ADMIN_LEVEL_B)) {
		client_print(id,print_console,"[AMX] Access Denied")
		return PLUGIN_HANDLED
	}
	if (read_argc() != 2)
	{
		client_print(id,print_console,"[AMX] Usage: amx_knifea <1 | 0>")
		return PLUGIN_HANDLED
	}
	new argstr[12]
	read_argv(1,argstr,12)
	new arg = str_to_num(argstr)
	if ((arg != 1) && (arg != 0))
	{
		client_print(id,print_console,"[AMX] Usage: amx_knifea <1 | 0>")
		return PLUGIN_HANDLED
	}
	client_print(id,print_console,"[AMX] Set Knife Arena Mode to %i",arg)
	KnifeEnabled = arg
	if (arg == 1)
		client_print(0,print_center,"Knife Mode Has Been Enabled!")
	if (arg == 0)
		client_print(0,print_center,"Knife Mode Has Been Disabled!")
	engclient_cmd(0,"weapon_knife")
	return PLUGIN_HANDLED
		
}

public switch_toknife(id) {
	if (KnifeEnabled == 1) 
	engclient_cmd(id,"weapon_knife")
	return PLUGIN_HANDLED
}

public plugin_init()
{
	register_plugin("Knife Arena","0.1","tcquest78")
	register_event("CurWeapon","switch_toknife","be","1=1","2!29")
	register_clcmd("amx_knifea","amx_enableknife",ADMIN_LEVEL_B,"amx_knifea <1 | 0>")
}

