Retrieving strings by using fake/dynamic natives
I have a problem regarding retrieving strings using fake natives..
For eg i made a plugin who's native can be used by other plugins to get a players name..so in the sub-plugin the native is used like this: PHP Code:
PHP Code:
I didnt try it but according to my knowledge, in pawn we can not return arrays through natives .... So is there any other method which can be used here...Thnx in advance |
Re: Retrieving strings by using fake/dynamic natives
For one take the native_ out of the function name, I don't see why that's there.
|
Re: Retrieving strings by using fake/dynamic natives
Quote:
PHP Code:
|
Re: Retrieving strings by using fake/dynamic natives
You can't return an array. Follow the Plugin API and Fake Native tutorials by Hawk to learn about array packing in natives.
|
Re: Retrieving strings by using fake/dynamic natives
Ah, well I didn't think about that. You can try:
PHP Code:
I think this might be an off day for me. |
Re: Retrieving strings by using fake/dynamic natives
Quote:
Quote:
i read the natives tutorial but regarding my question nothing is covered there so i came up with another idea: PHP Code:
PHP Code:
|
Re: Retrieving strings by using fake/dynamic natives
I assumed you were doing this for zombie mod or whatever and got the native to search for a zombie. Feel free to replace the search function with whatever you need to get.
Code:
|
Re: Retrieving strings by using fake/dynamic natives
You can return an array as long as the destination is the same size as the source. In the code in the first post, user_name needs to be declared as "new user_name[32]" and your return should be just "return name"
|
Re: Retrieving strings by using fake/dynamic natives
Quote:
PHP Code:
|
Re: Retrieving strings by using fake/dynamic natives
Quote:
set_string( destparam, string[], len ) |
| All times are GMT -4. The time now is 14:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.