Thread: [Solved] Copying 2D arrays by natives
View Single Post
Author Message
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 09-10-2016 , 08:18   Copying 2D arrays by natives
Reply With Quote #1

I have this:
Code:
native void GetMyArray(any thearray[1D_SIZE][2D_SIZE]);

public int Native_GetMyArray(Handle handler, int numParams)
{
	/* set array in native */
}
And this inside the main plugin, and the one I want to copy the array values to:
Code:
any thearray[1D_SIZE][2D_SIZE];
What I want to achieve, is something like that (in a separate plugin):
Code:
public void OnPluginStart()
{
	any thearray[1D_SIZE][2D_SIZE];
	GetMyArray(thearray);
}
How could I copy the whole array with a native? Would I have to do separate calls per each 1D cell?
__________________
retired

Last edited by shavit; 09-10-2016 at 11:40.
shavit is offline