06.10.2015, 11:24
Today I learned that CallLocalFunction and CallRemoteFunction do in fact support arrays, and it copies the array to the heap of the receiving AMX, so it's safe to use between filterscripts and/or the gamemode.
There is one caveat: you must have an integer argument passed after it, containing the array size.
Output:
There is one caveat: you must have an integer argument passed after it, containing the array size.
pawn Код:
new arr[] = {11, 22, 33, 44};
CallRemoteFunction("test", "ai", arr, sizeof(arr));
}
forward test(arr[], arrlen);
public test(arr[], arrlen) {
for (new i = 0; i < arrlen; i++) {
printf("arr[%d] = %d", i, arr[i]);
}
}
Код:
arr[0] = 11 arr[1] = 22 arr[2] = 33 arr[3] = 44