View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-21-2018 , 07:20   Re: Plugin API - How can transfer data properly
Reply With Quote #15

Quote:
Originally Posted by Natsheh View Post
what Hamlet suggested he meant to pass the array handler index to the other plugin by using a native.

PHP Code:
new Array:iHandler_array;

@
plugin_natives() {
         
iHandler_array ArrayCreate(size);

        
register_native("get_array_handler""_get_array_handler");
}

public 
_get_array_handler(pluginargs)
{
       return 
iHandler_array;

And here is the native to use in the other plugins.

PHP Code:
native Array:get_array_handler() 
And now you can apply the array public natives on the handler (ArraySetCell, etc....)
Why pass the array index when you can directly set the value?
__________________

Last edited by edon1337; 08-21-2018 at 07:20.
edon1337 is offline