Well, i’m working right now on a simple vehicles decoration for me server so i want to spawn some vehicles in random positions near the player so i’m just getting a random position near the player in a radius and after that just getting the cosset vehicle done but the problem is that the node is in the middle of the road just like:
but in want to pace them in the road so where the vehicles drive not in the middle of both sides…
function getNextPositionOnRoad(x, y, z)
local found = false
local roadType = 1
while not found do
found, outPos, outHeading = GetClosestVehicleNodeWithHeading(x, y, z, roadTypes[roadType], 3, 0)
roadType = roadType + 1
end
if found and not IsPointObscuredByAMissionEntity(outPos.x, outPos.y, outPos.z, 5.0, 5.0, 5.0, 0) then
return outPos, outHeading;
end
return false
end
This is the code i’m using to get the node position is possible to get the position on one side of the road not on the middle like in screenshot
i would do that if i can get the road size but i dont know where the vehicle will be spawned so i mean in what road type as they can be spawned in a one directional road.
Basiclly i want to place the vehicle in a right direction for example: