Raised This Month: $ Target: $400
 0% 

Loopin a function?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 03-01-2006 , 15:22  
Reply With Quote #4

Code:
#include <amxmodx> #define PLUGIN "looptime" #define VERSION "1.0" #define AUTHOR "NL)Ramon(NL" #define ONSECONDS 5.0   // must be a float #define OFFSECONDS 5.0  // must be a float new on = 0 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     set_task(OFFSECONDS,"seton")     set_task(0.1,"code",0,"",0,"b") } public seton(){     set_task(ONSECONDS,"setoff")     on = 1 } public setoff(){     set_task(OFFSECONDS,"seton")     on = 0 } public code() {     if(on == 1)         {         //code here     } }

UNTESTED test it yourself ( i think it should work )
It redoes the code every 0.1 if it is on
__________________
Um, hi.
Ramono is offline
 



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 20:18.


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