PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#define PLUGIN_NAME "x"
#define PLUGIN_VERSION "0.0.2"
#define PLUGIN_AUTHOR "x"
new only_disable_fl
public plugin_init()
{
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
register_impulse(100, "ClientCommand__Impulse")
only_disable_fl = register_cvar("only_disable_fl", "0") // Set 1 For Just Ignore When Terro Try To Use Flashlight
}
public ClientCommand__Impulse(id)
{
if(!is_user_alive(id) || cs_get_user_team(id) != CS_TEAM_T)
return PLUGIN_CONTINUE
else
{
if(get_pcvar_num(only_disable_fl))
client_print(id, print_center, "YOU ARENT ALLOWED TO USE FLASHLIGHT")
else
{
if(!cs_get_user_nvg(id))
cs_set_user_nvg(id, 1)
engclient_cmd(id, "nightvision")
}
}
return PLUGIN_HANDLED
}
I made cvar because no makes sence use flashlight to nightvision, since they can use n. So if you want just disable flashlight and shows message that they cant use flashlight set the cvar to 1.
If cvar is 0, it does nightvision instead of flashlight for Terrorists
__________________