There's probably an easier way to do the multi-dimensional array but I can't figure it out.
This only works with a multi-dimensional array that have a predetermined size at the top level and mid level. If you increase the array size on either of them it will fail on compilation.
Bug? No idea.
It may be easier to use a dynamic native. But either way you have to pass the size of the array to the subfunction.
Code:
#include <amxmodx>
public plugin_init() {
register_plugin("Test Plugin 8", "", "[ --{-@ ]");
new array[1][1][1];
test();
test(array);
test(array, "what");
}
stock test(array2d[][][]={{{0}}}, optionalvalue[]="") {
server_print("%d", array2d[0][0][0]);
server_print("Optional: %s", optionalvalue);
}
__________________