Raised This Month: $ Target: $400
 0% 

unregister_clcmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-19-2007 , 19:05   Re: unregister_clcmd
Reply With Quote #1

Rose, you know how to do this...
Code:
register_clcmd("zat_on", "nothing")

public nothing() {
    return PLUGIN_HANDLED
    // nothing...   
}
returning is the almost same result as returning plugin_continue
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-20-2007 , 16:41   Re: unregister_clcmd
Reply With Quote #2

Quote:
Originally Posted by dutchmeat View Post
Rose, you know how to do this...
Code:
register_clcmd("zat_on", "nothing")

public nothing() {
    return PLUGIN_HANDLED
    // nothing...   
}
returning is the almost same result as returning plugin_continue
Your point being?
[ --<-@ ] Black Rose is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-21-2007 , 11:20   Re: unregister_clcmd
Reply With Quote #3

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
Your point being?
My point is that you only hook the command, and then returning...
while return plugin_handled stops the command's functionality
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-21-2007 , 11:23   Re: unregister_clcmd
Reply With Quote #4

both of em returns, meaning both will stop the function.
[ --<-@ ] Black Rose is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-21-2007 , 16:58   Re: unregister_clcmd
Reply With Quote #5

Quote:
Originally Posted by dutchmeat View Post
returning is the almost same result as returning plugin_continue
This comes from the fact that PLUGIN_CONTINUE is #defined to be a constant integer, 0. By chance, the pawn compiler sets the PRI register (which is used to transport return values) to 0 when you simply write return.

However, relying on this coincidence is not a good idea; always return SOMETHING if the forward handler is expected to return a value. If the return value is ignored, use the keyword return without a "parameter".
__________________
hello, i am pm
PM is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode