Hello, I have a table with 5 cuboids:
cuboid[1] = {x,y,z,10,10,10}
cuboid[2] = {x,y,z,10,10,10}
etc
and I wanna check if there is any vehicle on these cuboids, if no then break the table i tried it
for _,v in ipairs(getElementsByType('vehicle')) do
outputChatBox('checking from ' .. getVehicleName(v) .. ' perspective')
for i=1, 5 do
if isElementWithinColShape(v, cuboid[i]) then
outputChatBox(i .. ' taken by ' .. getVehicleName(v))
else
outputChatBox(i .. ' free')
end
end
end
So i spawn 2 cars at 2 cuboids, infernus at 1st, cheetah at 2nd
checking from Cheetah perspective
1 free
2 taken by Cheetah
3 free
4 free
5 free
checking from Infernus perspective
1 taken by Infernus
2 free
3 free
4 free
5 free
the problem is that Cheetah sees that cuboid 1 is free while it's taken and infernus sees 1 is free
Could you help me?