Quote:
Originally Posted by Blizzard_87
No.
Reason. YamiKaitou said above.
|
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Random SetTask Number"
#define VERSION "1.0"
#define AUTHOR "Blizzard"
new Float:g_iTaskTimer; // set as global float to hold random number.
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_iTaskTimer = ( random_float( 15.0, 30.0 ) ); // execute random number for first time
set_task( g_iTaskTimer, "FunctionSetTask" ); // calling first task with a random time.
}
public FunctionSetTask( id ) {
//.. commands or what ever in here
// then set task again with random number
g_iTaskTimer = ( random_float( 15.0, 30.0 ) ); // get random number before setting task.
set_task( g_iTaskTimer, "Function", id ); // set same task with NEW random number
}
public Function( id ) {
if(task_exists(id)) {
remove_task(id);
FunctionSetTask(id);
}
/* Do something here */
}
__________________