Quote:
Originally Posted by redivcram
First of all, this should be in Suggestions/Request.
You can run tasks in your plugin_init().
Something like:
Code:
set_task(get_timeleft() - 300.0, "Hook5MinutesRemaining");
For 5 minutes or
Code:
set_task(get_timeleft() - 30.0, "Hook30SecondsRemaining");
For 30 seconds.
|
Hey man, for some reason the function gets executed right after I start the server. Any idea of why? This is how I registered it in the plugin_ini block:
PHP Code:
set_task(get_timeleft() - 30.0, "DoMagic")
EDIT:
I added an extra check in my function but I think this shouldn't be the normal process.
PHP Code:
if ((get_timeleft() - 30.0) > 50.0) {
return PLUGIN_HANDLED;
}