...
...
|
Re: ArrayGetString2
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. |
Re: ArrayGetString2
...
|
Re: ArrayGetString2
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. |
Re: ArrayGetString2
Quote:
|
Re: ArrayGetString2
...
|
Re: ArrayGetString2
...
|
Re: ArrayGetString2
Code:
native get_string(param, dest[], maxlen) 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). |
Re: ArrayGetString2
...
|
Re: ArrayGetString2
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. |
All times are GMT -4. The time now is 17:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.