plugin performance
Hi there :wink:
Few small questions about plugin performance 1) Which way is better? PHP Code:
or PHP Code:
2) Why amxmodx default plugins check users access level twice? in register_clcmd i.e PHP Code:
i.e PHP Code:
PHP Code:
|
Re: plugin performance
3)
PHP Code:
|
Re: plugin performance
about 3) is it okay to do that stuff? i mean to register events only when amx_whatever is 1?
If everything is okay, i think it is good way improve performance. i.e case 1: using plugon (similar to 3rd question) plugin checks amx_whatever value and gets 0, it dose not register any events,messages or whatever, yes? so plugin dose not interact with the game, yes? case 2: not using plugon plugin check amx_whaterver value and gets 0, it register couple of events like ResetHUD, or messages of round start. Every new round or when HUD is reseted, plugin calls defined function and check if amx_whatever is 0 or 1? QUESTION? Why force plugin call its function, and check amx_whatever value? when amx_whatever is 0 |
Re: plugin performance
Quote:
Quote:
3. PHP Code:
|
Re: plugin performance
3)
PHP Code:
PHP Code:
|
Re: plugin performance
Dr.G that random thing aint cool.
|
Re: plugin performance
lol why not? Cuz its in plugin_init() ??
|
Re: plugin performance
why need random? if he want register forwards when cvar is 1
|
Re: plugin performance
Oh its was just an simple exsample buddy
|
Re: plugin performance
1. If I have more than 1 say command in my plugin, then I hook "say" and check the command.
Otherwise, I just register the 1 command. 2. Just setting the flag in register_*cmd() doesn't enforce the flag. You have to enforce it yourself with cmd_access(), access(), or (get_user_flags() & ADMIN_*). 3. I think it would be best if you registered the events anyway, then checked to see if the cvar was enabled or disabled when they were called. Code:
|
| All times are GMT -4. The time now is 01:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.