14.02.2016, 19:23
@valych: Ok, I fixed this issue. Please update your plugin with the Shoebill-Updater.
You should now change your code as following:
1. Don't add an Integer.class for the Pawn's array length
and Pawn:
You can now of course change the order of the Integer and the Array if you want. But always keep in mind that after you pass an Pawn array to Shoebill, the size must follow directly after that. Like https://sampwiki.blast.hk/wiki/GetPlayerName
You should now change your code as following:
1. Don't add an Integer.class for the Pawn's array length
PHP код:
instance.registerFunction("java_TestArray", objects -> {
int someValue = (Integer) objects[0];
Integer[] array = (Integer[])objects[1];
for (int i = 0; i < array.length; i++) {
if(someValue == 33) {
array[i] = (i + 2) * 4;
} else {
array[i] = i+1;
}
}
return 1;
}, Integer.class, Integer[].class);
PHP код:
new array[32];
CallShoebillFunction("java_TestArray", 33, array, sizeof(array));
for(new i = 0; i < 32; i++) {
printf("array[%d] = %d", i, array[i]);
}
return 1;