Raised This Month: $12 Target: $400
 3% 

...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cristian505
Senior Member
Join Date: Oct 2020
Old 09-16-2021 , 06:17   ...
Reply With Quote #1

...

Last edited by Cristian505; 08-10-2022 at 14:27.
Cristian505 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-16-2021 , 07:28   Re: ArrayGetString2
Reply With Quote #2

Firstly, do not post code screenshots. Copy and paste the actual code.
Secondly, why in the world are you using style 1 natives? They are deprecated and should never be used. Notice the big red warning: http://amxmodx.org/api/amxmodx/param_convert.
I already told you to use get_string in your previous topic. Why did you completely ignore this and made a new topic? If you needed further help with get_string you should have posted in the original topic.
__________________

Last edited by HamletEagle; 09-16-2021 at 07:29.
HamletEagle is offline
Cristian505
Senior Member
Join Date: Oct 2020
Old 09-16-2021 , 07:52   Re: ArrayGetString2
Reply With Quote #3

...

Last edited by Cristian505; 08-10-2022 at 14:28.
Cristian505 is offline
hitD
Junior Member
Join Date: May 2017
Location: Lithuania
Old 09-16-2021 , 08:39   Re: ArrayGetString2
Reply With Quote #4

Stick to the old thread, second it should work, instead of using 1 style native switch to 0. Also you should read carefully API method as it clarify you.
If you can't do that here is the answer why it doesn't work. As in your image, it shows that you tried to use get_string with style 1.
"If used outside of a native callback, or the native was
created with style 1, an error will be thrown."

Also your get_string parameters are wrong.

Last edited by hitD; 09-16-2021 at 08:42. Reason: Edit
hitD is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-16-2021 , 08:48   Re: ArrayGetString2
Reply With Quote #5

Quote:
Originally Posted by Cristian505 View Post
get_string() no work lol
No, it works, you just failed to use it. Show what you tried.
__________________
HamletEagle is offline
Cristian505
Senior Member
Join Date: Oct 2020
Old 09-16-2021 , 10:09   Re: ArrayGetString2
Reply With Quote #6

...

Last edited by Cristian505; 08-10-2022 at 14:28.
Cristian505 is offline
Cristian505
Senior Member
Join Date: Oct 2020
Old 09-16-2021 , 10:53   Re: ArrayGetString2
Reply With Quote #7

...

Last edited by Cristian505; 08-10-2022 at 14:28.
Cristian505 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-16-2021 , 11:04   Re: ArrayGetString2
Reply With Quote #8

Code:
native get_string(param, dest[], maxlen)
param
Argument to retrieve, starting from 1

Why are you passing a dynamic array in there, how is that supposed to work? You have to pass a number corresponding to the index of the parameter you want to retrieve.

If you have a native like: native example(strParam[], anotherStrParam[]) then you would pass 1 to retrieve the value of strParam and 2 to retrieve the value of anotherStrParam.

Tag mismatch is not an error, it is a warning that happens when 2 tags do not match. For example, your ZombieName is a dynamic array tagged as "Array:" while the native does not expect such a tag for the first parameter("param" is not tagged).
__________________

Last edited by HamletEagle; 09-16-2021 at 11:05.
HamletEagle is offline
Cristian505
Senior Member
Join Date: Oct 2020
Old 09-16-2021 , 11:22   Re: ArrayGetString2
Reply With Quote #9

...

Last edited by Cristian505; 08-10-2022 at 14:28.
Cristian505 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-16-2021 , 14:03   Re: ArrayGetString2
Reply With Quote #10

For the last time, SHOW WHAT YOU TRIED. Show the code. I can't read your mind and see what mistake you made.

You literally just have to call get_param(1, stringVar, charsmax(stringVar)) and then stringVar will contain the string which you can then add inside the array using ArrayPushString.
__________________

Last edited by HamletEagle; 09-16-2021 at 14:03.
HamletEagle is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:32.


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