 |
|
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
|

02-21-2005
, 10:09
|
#2
|
PLUGIN_CONTINUE and PLUGIN_HANDLED are returned from AMXX Forwards and Registered Commands that tell AMXX what to do after your function has been executed.
If your function returns PLUGIN_CONTINUE you are telling AMXX to continue processing the same function in other plugins. An example would be
public plugin_cfg() { return PLUGIN_CONTINUE }
plugin_cfg() is an AMXX Forward function, and by returning PLUGIN_CONTINUE you are telling AMXX to continue processing the plugin_cfg() function of other plugins found in your plugins.ini listed *after* your plugin..
If you returned PLUGIN_HANDLED from plugin_cfg() then any other plugins that are listed below yours in plugins.ini which use the Forward plugin_cfg() will not be allowed to execute their respective plugin_cfg() function..
You should almost always return PLUGIN_CONTINUE from AMXX Forwards, however, there are logical exceptions...
Now, with Registered Commands, you get to "Invent" the name of the command and the name of the function that it calls, an example would be:
register_clcmd( "amx_stuff", "DoStuff" )
'amx_stuff' is the name of the command that we are inventing, and the respective Small C Function which we create we called 'DoStuff'..
Now, since probably no other AMXX plugin will have the same command 'amx_stuff' we don't need to worry about other plugins calling our invented command, so we are free to (and encouraged to) return PLUGIN_HANDLED which tells AMXX that after executing our 'DoStuff' command AMXX is done, and does not need to look for the same function from other plugins.
Basically, PLUGIN_CONTINUE tells AMXX to continue processing equivalent functions in other plugins, whereas PLUGIN_HANDLED tells AMXX the exact opposite, to stop proccessing equivalent functions in other plugins..
I hope that helps a bit..
|
|
|
|