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
__________________