Is using "entity think" faster than set_task and remove_task?
I need to "reset" task really often (by reset I mean remove the task and set it to a new time). Is worth creating an entity just for changing to pev_nextthink and hooking the think? If so, which is the proper way to hook it. Because with FM I hook all entities think and have to check the classname/whatevervalue. I think there was another hook which already filtered the think.
|
Re: Is using "entity think" faster than set_task and remove_task?
It is basically a choice between letting AMXX handle the timing or letting the HL engine deal with it.
You can use a global entity with a FM hook and then do an easy check to see if it is the same entity. The other option would be to use a custom classname and use engine's register_think native. |
Re: Is using "entity think" faster than set_task and remove_task?
Quote:
|
Re: Is using "entity think" faster than set_task and remove_task?
You can also create an entity with a not often used classname and register the think with Ham.
If you have only 1 ent in the plugin, filter by entity index. |
Re: Is using "entity think" faster than set_task and remove_task?
If I understood right, you can easily do that with engine:
Code:
public plugin_init()From my experience, set_task() is not too reliable on accurate timeline and can be set to a minimum of 0.1 seconds. |
Re: Is using "entity think" faster than set_task and remove_task?
I have a question related to this subject. What is more eficient (less resources) if you need to run a loop task on all players: to set individual task for each player at connection, or to set one task/entity that loops through all players and executes the function. This question might sound stupid, but I'm just curious.
|
Re: Is using "entity think" faster than set_task and remove_task?
Quote:
|
Re: Is using "entity think" faster than set_task and remove_task?
Quote:
|
| All times are GMT -4. The time now is 00:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.