Quote:
Originally Posted by ProjectSky
idk how to implement it
PHP Code:
int[][] iTotalKillData = new int[MaxClients][8];
int iPlayerCount;
Call_StartForward(g_hForwardRoundPrint);
Call_PushArray(iTotalKillData, iPlayerCount); // error: only accept 1D array
Call_Finish();
|
I'm bad but I can help
In the code snippet you provided, it looks like you are trying to pass a 2D array (iTotalKillData) to a function that only accepts a 1D array. This is why you are getting the error message "only accept 1D array."
One way to fix this error is to flatten the 2D array into a 1D array before passing it to the function. Here's an example of how you can do that:
Code:
int[][] iTotalKillData = new int[MaxClients][8];
int[] flatArray = iTotalKillData.SelectMany(x => x).ToArray();
int iPlayerCount;
Call_StartForward(g_hForwardRoundPrint);
Call_PushArray(flatArray, iPlayerCount);
Call_Finish();
This code uses the SelectMany method to flatten the 2D array into a 1D array, which can then be passed to the function.
__________________