Optimizing a plugin.Wich of these options is better?
well, i only want to know wich is the better and appropriate
|
Re: Optimizing a plugin.Wich of these options is better?
Quote:
Set a thinking entity with a custom class name, using engine: PHP Code:
Edit: Be aware that it depends on each case. Tell the exactly situation since probably it can be found a better way to handle it. |
Re: Optimizing a plugin.Wich of these options is better?
if i just want to execute a message?like te_delight, te_particleburst, tracers...
or if i just want to check the buttons that a player is pressing? and if the player pres x button execute something? |
Re: Optimizing a plugin.Wich of these options is better?
Quote:
Quote:
|
Re: Optimizing a plugin.Wich of these options is better?
thanks
|
Re: Optimizing a plugin.Wich of these options is better?
Quote:
Quote:
|
Re: Optimizing a plugin.Wich of these options is better?
1-that is just called on a player id...all the time...
2- ok. PD:please dont quote my codes, because i will delete my posts when this thread be solved, i dont want to show my codes to every one...or only for a time?lol! xd |
Re: Optimizing a plugin.Wich of these options is better?
Quote:
|
Re: Optimizing a plugin.Wich of these options is better?
One method is not the best solution to all situations.
To find player's buttons, use FM_CmdStart. To do something every frame and have it for a specific player, use client_PreThink(). To do something every frame for the whole server, use server_frame(). |
Re: Optimizing a plugin.Wich of these options is better?
To execute something every 0.1 seconds, joaquim's way is really fine, you should consider it (you can also read Hawk552 tuts about tasks)
For your message code, this would be better : -Don't use floats in you don't really need some -> so use get_user_origin -> faster -> message_begin -> faster -> write_coord -> faster - set_user_rendering vs fm_set_rendering should be ~ 7 times faster PHP Code:
|
| All times are GMT -4. The time now is 02:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.