Jump to content

How to create a Marker to transport people?


Jaysds1

Recommended Posts

OMG MAN YOU REPOST THIS

One time i posted this!

But now its my time for help :)

The Code:

Marker = createMarker (1686,-2434,12.6,"cylinder", 1.5, 0, 255, 0, getRootElement() ) 
  
function MarkerHit ( hitElement, dimension ) 
    if source == Marker then 
        if getElementType ( hitElement ) == "player" then 
            setElementPosition ( hitElement, 1686,-2434,1000) 
        end 
    end 
end 
  
addEventHandler ( "onMarkerHit", getRootElement(), MarkerHit ) 

I think its this you need

Cya Later,

Maria.

Link to comment

or

  
local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
function MarkerHit( hitElement, matchingDimension ) 
      setElementInterior ( source, 1, 2233.91, 1714.73, 1011.38 ) 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) 
  

Link to comment

Well, i would recommend using a table to store the markers.

local myMarkers = {} 
myMarkers[1] = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) 
myMarkers[2] = createMarker( -702, 969, 11, 'cylinder', 2.0, 255, 0, 0, 150 ) 
  
--markerID, interiorID, posX, posY, posZ 
local markersData = { 
{1, 1, "2233.91", "1714.73", "1011.38"}, 
} 
  
function MarkerHit( hitElement, matchingDimension ) 
for index,markers in pairs(myMarkers) do 
if (source == markers) then 
setElementInterior (hitElement, markersData[index][2], markersData[index][3], markersData[index][4], markersData[index][5]) 
    end 
  end 
end 
addEventHandler( "onMarkerHit", getRootElement(), MarkerHit ) 

So, you only have to create the marker using the example, and add the data to the markersData table.

Link to comment
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...