Raised This Month: $ Target: $400
 0% 

Solved hook to specific timestamp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Watermelonnable
Member
Join Date: Feb 2017
Old 12-04-2019 , 12:14   Re: hook to specific timestamp
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
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;


Last edited by Watermelonnable; 12-04-2019 at 13:43.
Watermelonnable 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 18:03.


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