Raised This Month: $ Target: $400
 0% 

Repeat/loop function as long as long using function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LynX
Veteran Member
Join Date: Oct 2004
Old 03-23-2005 , 15:15   Repeat/loop function as long as long using function
Reply With Quote #1

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
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode