Well guys, I had tried all the formulas I can guess without positive results, before comes here, but nothing change here.
I had wrote an script based in the smallg¡s guidelines, as follow...
jeepDX = 0
jeepDY = 0
jeepDZ = 0
jeepDist = 0
local ani = 0
local distance = 10
function mobilebarrier_init(e)
end
function mobilebarrier_main(e)
--if g_Entity[7] ~= nil then
jeepDX = g_Entity[7]['x'] - g_Entity[e]['x'];
jeepDY = g_Entity[7]['y'] - g_Entity[e]['y'];
jeepDZ = g_Entity[7]['z'] - g_Entity[e]['z'];
jeepDist = math.sqrt(math.abs(jeepDX^2)+math.abs(jeepDY^2)+math.abs(jeepDZ^2));
Prompt(jeepDist)
if jeepDist <= distance and ani == 0 then
ani = 1
SetAnimationFrames(e,0,50)
PlayAnimation(e)
elseif jeepDist > distance and GetAnimationFrame(e) == 50 then
SetAnimationFrames(e,50,0)
PlayAnimation(e)
ani = 0
else
StopAnimation(e)
end
end
--end
jepp in editor...
Error message...
It looks like Reloaded does not take the number 7 as ID of the entity (in this case the jeep one), and I do not understand why?.
Perhaps I missed something, but I assume than Reloaded knows all the entities's positions/coodinates, when the game launch (ingame), and the entities's IDs too. Then why it is not able to identify 7 as jeep ID number?.
There is a funtion than loop all the entities in the map and hold all the position/id in any sort of array/table for later use.
Then, why this happens????
Reloaded knows the jeep and barrier ids and coordinates, why does not make a simple matemathical calculations and thrown the results.???
As I said above, I should missed something here.
3com