roaddog Posted April 15, 2022 Share Posted April 15, 2022 So i want to create markers but they all need to be between some range, example: create marker if distance between each other is 50 using getDistanceBetweenPoints3D function createMissions() local max = max or 60 for i, v in ipairs(clients_marker) do if last_markers[1] and last_markers[2] and last_markers[3] then max = math.floor(getDistanceBetweenPoints3D(v[1] , v[2] , v[3], last_markers[1], last_markers[2], last_markers[3]) ) outputChatBox(max) end if max >= 60 then job_markers[i] = createMarker(v[1] , v[2] , v[3]+0.2, "cylinder", 1, 255, 255, 0, 170 ) if job_markers[i] then setElementData(job_markers[i], "el:jtickets", true) setElementData(job_markers[i], "el:jobtype", jobtype[math.random(1,3)]) job_markers_blip[i] = createBlip(v[1] , v[2] , v[3], 0, 1, 200, 200, 0, 255) last_markers = {v[1] , v[2] , v[3]} end end end outputChatBox(#job_markers) end above is working but not for all markers, just last created marker if you get what i mean, thank you for helping Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now