local ev = require 'samp.events'
-- callback which is triggered when checkpoint creates
function ev.onSetRaceCheckpoint(type, position, nextPosition, size)
sampAddChatMessage('race checkpoint created') -- for example
sampAddChatMessage('position: x = ' .. tostring(position.x) .. ', y = ' .. tostring(position.y) .. ', z = ' .. tostring(position.z))
-- we can find position using: position.x, position.y, position.z
end
-- same, but checkpoint removes
function ev.onDisableRaceCheckpoint()
sampAddChatMessage('race checkpoint removed') -- for example
end