What is Return 1 and how do I use Return 1
2 replies



21.01.22 06:46:39 am
Hello, so I'm curious about Return 1 and don't know what it is for? I hope you guys can help me

[ String+ ] make string library more extended and advanced! | Kooshie is the best youkai

About the
So simply,
But I'm being ignorant by simply telling you that, I know what you mean.
I simply wanted you to understand that
In some of the CS2D hooks, a return value is accepted.
Example of a hook with a return value:
hitzone
This hook specifies what it expects to receive and what it will do when receiving that value.
The values of which are documented at the bottom of the page under "returned values".
CS2D's most common return value is 1, which usually means "stop" or "cancel" whilst 0 is the opposite, "continue".
But this isn't always applicable, so read the documentation of the hook to learn what to return and when, depending on the task at hand.
On the other hand, hooks such as
second will not accept any returned values, as it just wouldn't make any sense.
Why would you want to stop the second hook for example?
This should give you enough context and information to hopefully understand what returning does in CS2D hooks.
return
keyword: https://www.lua.org/pil/4.4.htmlSo simply,
return 1
will return the number 1 to the function's caller.But I'm being ignorant by simply telling you that, I know what you mean.
I simply wanted you to understand that
return 1
isn't a magical CS2D super programming spell.In some of the CS2D hooks, a return value is accepted.
Example of a hook with a return value:

This hook specifies what it expects to receive and what it will do when receiving that value.
The values of which are documented at the bottom of the page under "returned values".
CS2D's most common return value is 1, which usually means "stop" or "cancel" whilst 0 is the opposite, "continue".
But this isn't always applicable, so read the documentation of the hook to learn what to return and when, depending on the task at hand.
On the other hand, hooks such as

Why would you want to stop the second hook for example?
This should give you enough context and information to hopefully understand what returning does in CS2D hooks.
edited 1×, last 21.01.22 11:18:36 am
Look at me standing, here on my own again
Thank you, I am curious about Return 1. Since I am new to CS2D coding.
[ String+ ] make string library more extended and advanced! | Kooshie is the best youkai




