Ok I got that working
Is there a more convenient way to the evenhandlers, = marks etc. in my script?
-- blips
function blips ( )
createBlip ( 1713.02, 917.98, 10.80, 27 ) -- mechanic
createBlip ( 1381.99, 1019.81, 10.82, 51 ) -- store
storeMarker = createMarker (1374.50, 1020, 12.5, 'arrow', 2.5, 255, 136, 0, 250 )
mechMarker = createMarker (1713, 913, 12.0, 'arrow', 2.0, 255, 136, 0, 250 )
mechMarkerBack = createMarker (2333.17, -1075.96, 1049.02, 'arrow', 2.0, 255, 136, 0, 250 )
setElementInterior(mechMarkerBack, 6, 2333.17, -1075.96, 1049.02)
addEventHandler ( "onMarkerHit", storeMarker, MarkerHit )
addEventHandler ( "onMarkerHit", mechMarker, MarkerTeleport )
addEventHandler ( "onMarkerHit", mechMarkerBack, MarkerTeleportBack )
end
addEventHandler ( "onResourceStart", resourceRoot, blips )
-- markers
-- storeMark
function MarkerHit ( thePlayer, matchingDimension )
local elementType = getElementType ( thePlayer )
if ( elementType == "player" ) then
outputChatBox ( "You hit the marker", thePlayer, 255,0,0 )
givePlayerMoney ( thePlayer, 5000 )
end
end
-- mechMark
function MarkerTeleport ( thePlayer, matchingDimension )
local elementType = getElementType ( thePlayer )
if ( elementType == "player" ) then
outputChatBox ( "You hit the marker", thePlayer, 255,0,0 )
setElementInterior(thePlayer, 6, 2333.0330, -1073.9600, 1049.0230)
end
end
-- mechMark - LEAVE
function MarkerTeleportBack ( thePlayer, matchingDimension )
local elementType = getElementType ( thePlayer )
if ( elementType == "player" ) then
outputChatBox ( "You hit the marker", thePlayer, 255,0,0 )
setElementInterior(thePlayer, 0, 1713.02, 917.98, 10.80)
end
end