05.07.2014, 21:05
Is there a way to get numargs/getarg to work with multidimensional arrays? This is my current code
Works like a charm if i call it like funcname(playerid, "hello", "world"); but I don't always know the amount of arguments i want to insert. Instead I wanted to use a multidimensional array
But I don't know how to get the values since getargs only seems to support simple arrays as arguments.
Code:
stock funcname(playerid, ...) { new args = numargs(), index, str[1024]; for(new i = 1; i < args; i++) { index = 0, strdel(str, 0, sizeof(str)); do str[index] = getarg(i, index); while (str[index++] != 0); } }
Code:
new str[][] = {"hello", "world"}; funcname(playerid, str);