-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pawn_register_callback, handler_return and callback parameters #19
Comments
Hello, the function seems to be working as intended: pawn_register_callback("OnPlayerConnect", "AntiFlood_OPC", handler_return, "d", 0); This creates a closure from public AntiFlood_OPC(always_zero, &break_hook_chain, playerid)
{
...
} I should point out three things. First, Second, returning a non-zero value is sufficient to break the chain, even without Third, the parameter introduced by |
Oh, I thought I had to pass a value for the return handler. I also used I tried now your way and without |
A normal handler:
calls
AntiFlood_OPC
with correctplayerid
. A special handler withhandler_return
callsAntiFlood_OPC
with correctreturn value
but wrongplayerid
.From wiki:
flags specify how the function should be handled. handler_return will place an additional by-ref parameter before the callback parameters to specify what should be returned from the callback.
playerid
has value of 3964 when debugging it. If I change value 0 frompawn_register_callback
to something random, it is printed correctly so the issue is only with the callback parameters.The text was updated successfully, but these errors were encountered: