Questions about functions
1) I'm always a robot when it come to function registering.
I always set them with public tag when needed and avoid to use it when not needed. But what do public tag exactly ? 2) Question about usage of a custom function with inside a return PLUGIN_* value in forward or event hook. Does the function trigger the same return in the forward/event hook. Same question if the function is marked as public. 3) I saw recent usage of an @ instead of using public. IE : register_clcmd("test", "@cmd_test") @cmd_test(id) I have no idea of when to use this. |
Re: Questions about functions
1) Unless the function is callback or forward, you don't need "public". You use it when you need the function be accessed from outside your plugin scope.
2) Not sure to understand. In a custom function, you return whatever you want. 3) "@function() {}" is the same as "public function() {}". It can be handy if you do some macro with it but usually, I like you use it to differentiate callback from forward (just a visual hint). |
Re: Questions about functions
Thanks for your response.
About question 2 : IE : PHP Code:
|
Re: Questions about functions
Unless you check my_custom_function() for a specific returned value in cmd_awp(), no. If you want to affect cmd_awp(), you would need to use "return my_custom_function()".
|
| All times are GMT -4. The time now is 17:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.