I'm not sure if my set_tasks are the problem but I can't figure out what the actual problem is. When the server starts up, the cvar is defaultly set to 1 and when I change it to 0. It works but when I want to set it back to 1 again. Nothing works apparently.
PHP Code:
new zomb_lightning
public plugin_init() {
zomb_lightning = register_cvar("zs_lightning","1")
set_task(1.0,"lightning_effects")
}
public lightning_effects() {
if(get_pcvar_num(zomb_lightning))
{
set_lights("a")
set_task(random_float(10.0,17.0),"thunder_clap",12175)
}
else if (!get_pcvar_num(zomb_lightning))
{
set_lights("b")
remove_task(12175)
}
return PLUGIN_HANDLED
}
public thunder_clap()
{
set_lights("s")
client_cmd(0,"speak ambience/thunder_clap.wav")
set_task(1.0,"lightning_effects",12175)
}
__________________