Jump to content

Markers


2FIDDY

Recommended Posts

Hello everyone, how to make several markers in the interior? Tell me please.
 

for i,v in pairs(blackjack.poses) do
	blackjack.marker = createMarker( 1958.68359375, 1020.1581420898, 991.46875, "cylinder", 0.75, 100, 255, 100, 100)
	setElementInterior(blackjack.marker, 10)
	setElementDimension(blackjack.marker, v[5])
	addEventHandler("onClientMarkerHit", blackjack.marker, function(element, dim)
		if element == localPlayer and dim then
			if not isPedInVehicle(localPlayer) then
				local verticalDistance = Vector3(getElementPosition(localPlayer)).z - Vector3(getElementPosition(source)).z
				if verticalDistance > 3 or verticalDistance < -1 then
		    	    return
		    	end
		    	blackjack.visible = true
				showCursor(true)
				addEventHandler("onClientRender", root, blackjack.render)
			--	showChat(false)
				addEventHandler("onClientKey", root, cancelEvent)
			end
		end
	end)
end

Add turned out kind of like adding this(indicated below). But I have no idea how to do it in the interior. I'm already tired, stupid me.

local blackjackMarkers = {
    [ createMarker( 1958.68359375, 1020.1581420898, 992.46875, "cylinder", 0.75, 100, 255, 100, 100) ] = true,
	[ createMarker( 1958.68359375, 1015.5797119141, 992.46875, "cylinder", 0.75, 100, 255, 100, 100) ] = true,
}

 

Link to comment
local markersData = {
  --{x, y, z, interior, dimension},
  }

function createBlackjackMarkers()
  for i, m in ipairs(markersData) do
      local newMarker = createMarker( m[1], m[2], m[3], "cylinder")
      setElementInterior(newMarker, m[4])
      setElementDimension(newMarker, m[5])
      -- add your event handler here
  end

Hello, if i understand well i would do something like that

  • Like 1
Link to comment

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...