This should work for admins only:
local markers = {}
local blips = {}
function consoleCreateMarker ( playerSource )
if ( hasObjectPermissionTo ( playerSource, "function.kickPlayer", false ) ) then
if ( hasObjectPermissionTo ( getThisResource (), "function.kickPlayer", true ) ) then
if ( playerSource ) then
local x, y, z = getElementPosition ( playerSource )
markers[playerSource] = createMarker ( x, y, z, "checkpoint", 2, 255, 0, 0, 255 )
blips[playerSource] = createBlipAttachedTo(markers[playerSource], 53)
end
end
end
end
addCommandHandler ( "createmarker", consoleCreateMarker )
function consoleDestroyMarker ( playerSource )
if ( isElement(markers[playerSource]) and isElement(blips[playerSource]) ) then
destroyElement(markers[playerSource])
destroyElement(blips[playerSource])
markers[playerSource] = nil
blips[playerSource] = nil
end
end
addCommandHandler ( "destroymarker", consoleDestroyMarker )