local sampev = require 'lib.samp.events'
local active = true
function sampev.onSetCheckpoint(vector,rad)
vector = vector
if active and vector then
lua_thread.create(function()
while active do
wait(0)
local x3, y3, z3 = getCharCoordinates(PLAYER_PED)
printStringNow("Distance: "..(math.floor(getDistanceBetweenCoords3d(vector.x,vector.y,vector.z, x3, y3, z3))).." m",1)
if getDistanceBetweenCoords3d(vector.x,vector.y,vector.z, x3, y3, z3) < 15 then active = false end
end
end)
end
end