Raised This Month: $ Target: $400
 0% 

Help with time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 12-31-2013 , 06:57   Re: Help with time
Reply With Quote #1

Just pause the plugin or remove the task when it's done.
Efficient.

Here's another function you can use though i'm planning on improving it.
Code:
/*  set_timetask (const Hour, const Minute, const Second, const function[], id = 0, const parameter[] = "", len = 0) * Creates a task to execute function at given time. * Does not repeat. */ stock set_timetask(const Hour, const Minute, const Second, const function[], id = 0, const parameter[] = "", len = 0) {         new curHour, curMinute, curSecond;     time(curHour, curMinute, curSecond);     new curTime = curHour * 3600 + curMinute * 60 + curSecond;     new goalTime = Hour * 3600 + Minute * 60 + Second;         new taskTime = goalTime - curTime;         if ( taskTime < 0 )         taskTime += 86400; // Tomorrow         return set_task(1.0 * taskTime, function, id, parameter, len); }
__________________

Last edited by Black Rose; 12-31-2013 at 07:05.
Black Rose is offline
Reply



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 10:07.


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