Skip to content
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

a question about default callbacks #17

Closed
omcho420 opened this issue Aug 5, 2019 · 3 comments
Closed

a question about default callbacks #17

omcho420 opened this issue Aug 5, 2019 · 3 comments

Comments

@omcho420
Copy link

omcho420 commented Aug 5, 2019

Is it possible to "re-write" the default callbacks, so we can use dynamically sized strings in default callbacks

Example:
public OnPlayerText(playerid, text[])

I started using this plugin few hours ago and I'm a newbie in pawn so I would like to know if we can do this or is "text[]" already a dynamically sized string by default?

@omcho420
Copy link
Author

omcho420 commented Aug 5, 2019

I tried editing the a_samp file to "forward OnPlayerText(playerid, String:text[]);" it seems to work but I'm not sure that it's that easily editable, right?

@IS4Code
Copy link
Owner

IS4Code commented Aug 5, 2019

There is no need to. When a callback is executed, the necessary space for the string is always allocated so it fits. Use str_new to construct the dynamic string if you need it.

@omcho420
Copy link
Author

omcho420 commented Aug 5, 2019

Thanks for the information and sorry for opening an 'issue' for this

@omcho420 omcho420 closed this as completed Aug 5, 2019
This was referenced Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants