I need this : that if I activated some function, one function loops untill I deactivate function.
So, I did something like this:
Code:
#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>
public plugin_init()
{
register_plugin("Loop_function","dunno","LynX")
register_clcmd("function","function_activation")
register_clcmd("function_off","function_deactivate")
return PLUGIN_CONTINUE
}
new iClientCheck[33]
public function(id)
{
iClientCheck[id] = 1
entity_get_float( id, EV_FL_fuser4 )
entity_set_float( id, EV_FL_fuser4, 1000.0 )
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,1)
set_task(0.1,"checkFunction")
return PLUGIN_HANDLED
}
public checkFunction(id)
{
if ( iClientCheck[id] !=1
return PLUGIN_CONTINUE
set_task(0.1, "glowFX", id, _, _, "a")
return PLUGIN_HANDLED
}
public loopFunction(id)
{
entity_get_float( id, EV_FL_fuser4 )
entity_set_float( id, EV_FL_fuser4, 1000.0 )
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderTransAlpha,1)
return PLUGIN_HANDLED
}
public function_deactivate(id)
{
set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,255)
return PLUGIN_HANDLED
}
I need that function called "loopFunction" loops all the time if function called "function" is on. BUT, when I activate "function_deactivate", I want that it stops looping... Any help, peeps?
Thnx
__________________