Pcvars are faster than normal cvars...
Well, the code should be something like this, but i am not sure:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <csx>
#include <fun>
const g_GrenadeNum = 5
new p_Enable
public plugin_init()
{
register_plugin("HE Only mode", "0.1", "AlliedModder")
register_event("CurWeapon", "event_he_off", "be", "1=0", "2=4")
p_Enable = register_cvar("amx_he_only", "0")
}
public event_he_off(id)
{
if (!get_pcvar_num(p_Enable) )
return PLUGIN_HANDLED
engclient_cmd(id, "weapon_hegrenade")
client_print(id, print_center, "HE only mode is on. You can't swith your weapons!")
}
public grenade_throw(id , greindex , wId )
{
if ( wId == CSW_HEGRENADE )
cs_set_user_bpammo(id , CSW_HEGRENADE , g_GrenadeNum + 1 )
}
But about the /hemode, that is a command, not cvar... to do this i think you have to use bools or condition operators maybe...
__________________