So this is what I have so far, a script for blips and markers for my gamemode.
The blips are working fine, but I can't seem to get the markers working. Any ideas on how to fix this?
Perhaps it is an issue with the gamemode I'm running, because they're no elements assigned?
rootElement = getRootElement()
local myMarker = createMarker(-1374.29, 1019.93, 10.8, 'arrow', 1.75, 255, 136, 255, 100)
-- markers
function MarkerHit( thePlayer, matchingDimension )
local elementType = getElementType( thePlayer )
outputChatBox("You hit the marker", getRootElement(), 255,0,0 )
givePlayerMoney(thePlayer, 5000)
end
addEventHandler( "onMarkerHit", myMarker, MarkerHit )
-- blips
function blips()
createBlip(1713.02, 917.98, 10.80, 27) -- mechanic
createBlip(1381.99, 1019.81, 10.82, 51) -- store
end
addEventHandler("onResourceStart", rootElement, blips)
Server lua:
local spawnX, spawnY, spawnZ = 1713.02, 917.98, 10.80
function joinHandler()
spawnPlayer(source, spawnX, spawnY, spawnZ)
fadeCamera(source, true)
setCameraTarget(source, source)
setPedSkin ( source, 50 )
outputChatBox("Welcome to My Server", source)
end
addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
-- retrieve a table with all flag elements
local flagElements = getElementsByType ( "tdm" )
-- loop through them
for key, value in pairs(flagElements) do
-- get our info
local posX = getElementData ( value, "posX" )
local posY = getElementData ( value, "posY" )
local posZ = getElementData ( value, "posZ" )
end