local C = createVehicle ( 547, 2506.1220, -1680.1697, 13.5765 )
setVehiclePaintjob ( C, 2 )
setVehicleDamageProof ( C, true )
setElementData ( C, "eventVehicle", true )
addCommandHandler ( "obj",
function ( thePlayer )
if ( not isPedInVehicle ( thePlayer ) ) then
outputChatBox ( "You're not in a vehicle.", thePlayer )
return
end
if getElementData ( getPedOccupiedVehicle ( thePlayer ), "eventVehicle" ) then
if ( isElement ( marker ) ) then
destroyElement ( marker )
else
local x, y, z = getElementPosition ( C )
marker = createObject ( 1318, x, y, z + 2, 0, 0, 0 )
attachElements ( marker, C, 0, 0, 2 )
end
else
outputChatBox ( "You're in the wrong vehicle.", thePlayer )
end
end
)