12.12.2015, 15:49
Alright so I got a simple loop to check for valid objects from the 2d array. Now the problem is quite simple, it will detect objects that have been previously destroyed as valid.
Testobject are 3 objects created under GameModeInit
PHP код:
new testobject[3];
CMD:test(playerid,params[]) {
new Float:X, Float:Y, Float:Z;
for(new i = 0; i < sizeof(TestObject); i++) {
if(IsValidDynamicObject(TestObject[i])) {
GetDynamicObjectPos(TestObject[i], X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 5, X, Y, Z)) {
printf("in range of the object");
}
}
}
return true;
}