you can use tables to write xyz marker positions like that:
markers = {
{x,y,z},
{x2,y2,z2},
}
Then you can detect markers with onClientMarkerHit or onMarkerHit. This events gives you a possibility to move to the next step (create next marker).
You can use here setElementData to select next marker.
Example:
markers = {
{x,y,z},
{x2,y2,z2},
}
function next_mark(pl)
if not pl then pl = localPlayer
local num = getElementData(pl,"currentMarker") or 1
local cur_x,cur_y,cur_z = unpack( markers[num] )
checkpoint = createMarker(cur_x,cur_y,cur_z,"checkpoint",2)
num = num + 1
setElementData(pl,"currentMarker",num)
end
addEventHandler("onClientMarkerHit",getRootElement(),function(player)
destroyElement(checkpoint)
next_mark(player)
end)
I'm not sure that it works\\ But i hope that you understood me