Raised This Month: $ Target: $400
 0% 

Doing something on specific date-time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-22-2011 , 23:28   Re: Doing something on specific date-time
Reply With Quote #9

Quote:
Originally Posted by Hunter-Digital View Post
Is there a reason for creating an entity ? For this trivial thing set_task() is enough
It may seem like overkill to create a thinking entity versus just using set_task(). But I was thinking that if the task is not going to be called for 30-45 minutes, the CPU will be checking every cycle to see if its time to execute the task; creating an entity and setting nextthink to task time and be done with it seems like a cheaper approach. Will a difference be noticed using either, probably not, but IMO it is the proper\efficient way.

Quote:
Originally Posted by Hunter-Digital View Post
Also, mp_timelimit could verry likely change during the game and it could also be 0, so I dunno if that prediction could help or hurt :}

A possibly needed thing would be to check against changelevel delays... a task could fail if the level changes right before the task should occur and init the plugin right after it should've occured, then it's just ommited.
There are a lot of "what ifs?" that can be thrown into just about any situation\condition in a plugin. What I put together is just a rough skeleton of how to execute a task at a particular time, the end-scripter can put in all of the checks.
__________________

Last edited by Bugsy; 09-22-2011 at 23:49.
Bugsy is online now
 



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 19:40.


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