You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, that is already possible, see the wiki. The tag is AmxStringBuffer: in that case. However note that since v1.4.2, both tags should behave more or less the same, so the code you should actually be valid.
Unfortunately, printf cannot be modified in such a way, because it doesn't use the standard AMX API to access its parameters. For variadic functions (with ...), the conversion to AmxString is not done automatically and must be done manually.
and it answered my question. I am asking about the variadic arguments.
Hi, I don't think that using str_buf_addr will work on my case.
As per native function, I want to use it on pawn-templates by Southclaws. (I made my own, but it's not on the github yet, uses the latest samp-rs, just linked Southclaws' plugin for example :))
That one should work in theory (just prefer AmxStringBuffer instead of AmxString). If not (please share how exactly it does not work), it might be an issue with pawn-templates. I know there is (was?) a deficiency in samp-rs that made returning these problematic.
Don't confuse me like that. 😄 I thought the ... was meant to be a placeholder. Of course you can't use it like that, that is a limitation of Pawn.
There are a few options ‒ use #emit to call it manually or y_va for nicer syntax. PawnPlus also offers a solution ‒ list_get_args("+"), list_new_args in combination with a macro, and pawn_call_native to call the native with the l specifier. This however won't work if the argument is supposed to be a reference.
Repository owner locked and limited conversation to collaborators on Sep 10, 2025
Activity
IS4Code commentedon Aug 25, 2025
Yes, that is already possible, see the wiki. The tag is
AmxStringBuffer:in that case. However note that since v1.4.2, both tags should behave more or less the same, so the code you should actually be valid.Tiaansu commentedon Aug 26, 2025
Hello, an update to this. I just read this part:
and it answered my question. I am asking about the variadic arguments.
IS4Code commentedon Aug 26, 2025
Then see the example below that paragraph, about
CallLocalFunction. It works too, but you need to callstr_buf_addrmanually.Do you have any particular code or native function you are trying to adapt? I am not aware of any variadic functions that would use output buffers.
Tiaansu commentedon Sep 3, 2025
Hi, I don't think that using
str_buf_addrwill work on my case.As per native function, I want to use it on
pawn-templatesby Southclaws. (I made my own, but it's not on the github yet, uses the latest samp-rs, just linked Southclaws' plugin for example :))IS4Code commentedon Sep 8, 2025
Why? Have you tried it?
Tiaansu commentedon Sep 9, 2025
Yes. It works like for this:
but in my case (returning PawnPlus string) it won't work (or is there a way to do this?):
IS4Code commentedon Sep 9, 2025
That one should work in theory (just prefer
AmxStringBufferinstead ofAmxString). If not (please share how exactly it does not work), it might be an issue with pawn-templates. I know there is (was?) a deficiency in samp-rs that made returning these problematic.Tiaansu commentedon Sep 10, 2025
Hi, the deficieny in samp-rs is now gone and this line of code below is working fine:
what I mean is not working is this:
Link to my pawn-templates repo: https://github.com/Tiaansu/pawn-templates
IS4Code commentedon Sep 10, 2025
Don't confuse me like that. 😄 I thought the
...was meant to be a placeholder. Of course you can't use it like that, that is a limitation of Pawn.There are a few options ‒ use
#emitto call it manually or y_va for nicer syntax. PawnPlus also offers a solution ‒list_get_args("+"),list_new_argsin combination with a macro, andpawn_call_nativeto call the native with thelspecifier. This however won't work if the argument is supposed to be a reference.