Is it possible to optimize this code?
Code:
|
Re: Is it possible to optimize this code?
Quote:
|
Re: Is it possible to optimize this code?
PHP Code:
If the flags meant anything important, you'll have to add another check to the if statements. |
Re: Is it possible to optimize this code?
Thanks dude, i want exacaly it.
|
Re: Is it possible to optimize this code?
That way it will check every single command or text what you say to chat. Ofc it won't matter if you do it only in this plugin. But just notice that if you have 20 plugins that checks all say commands: Always when someone says something to chat it will run to 20 function. That's why it's -well someone would say- better to use exact chat checks.
|
Re: Is it possible to optimize this code?
Or try this, i like it more
PHP Code:
|
Re: Is it possible to optimize this code?
anakin_cstrike, if you iterate over g_Commands in plugin_init() and use said loop to call register_clclmd() and still retain one public fuction, you keep the extensibility without having to pass through the VM every time someone uses chat.
|
Re: Is it possible to optimize this code?
But if you hook them to the same function, you would have to read the command to figure out which to display.
|
Re: Is it possible to optimize this code?
Yes, of course, but he's currently doing the same thing whether it's a command we're interested in or someone talking about their cat that just got run over.
|
| All times are GMT -4. The time now is 23:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.