AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about return value. (https://forums.alliedmods.net/showthread.php?t=251970)

ghost95v 11-23-2014 06:15

Question about return value.
 
Hello, what exactly return 1; / return -1; and return 0; does do? Thnx :)

HamletEagle 11-23-2014 06:25

Re: Question about return value.
 
return 1 is the same as return PLUGIN_HANDLED and it will stop the information from being send to server or to other plugins.
return 0 is the same as return PLUGIN_CONTINUE and it will let the information go everywhere it should.
return 2 is the same as return PLUGIN_HANDLED_MAIN stops the information from being send to server, but it will send it to other plugins.
return -1 is just a custom return. You can use return -345 but you doesn't make sense.

YamiKaitou 11-23-2014 07:08

Re: Question about return value.
 
Quote:

Originally Posted by HamletEagle (Post 2227307)
return 1 is the same as return PLUGIN_HANDLED and it will stop the information from being send to server or to other plugins.
return 0 is the same as return PLUGIN_CONTINUE and it will let the information go everywhere it should.
return 2 is the same as return PLUGIN_HANDLED_MAIN stops the information from being send to server, but it will send it to other plugins.
return -1 is just a custom return. You can use return -345 but you doesn't make sense.

Please do not explain stuff out of context. If it was a custom function or a Ham/Fakemeta forward, your explanation would be incorrect.

Quote:

Originally Posted by ghost95v (Post 2227306)
Hello, what exactly return 1; / return -1; and return 0; does do? Thnx :)

They are just return values. Without the rest of the code, we can't tell you anything else


All times are GMT -4. The time now is 17:34.

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