Jump to content

[HELP]Attaching Blip to markers in tables.


Om.

Recommended Posts

server.lua

  
markerSize = 1.5 
r, g, b = 255, 255, 0 
pilot = { 
    {414.2, 2533.5, 18.1}, -- VM Airport 
    {1449.92236, -2287.12622, 12.3}, -- LS Airport 
    {-1226.55, 55.48, 13.13}, -- SF Airport 
} 
  
for k, v in pairs(pilot) do 
    marker = createMarker(v[1], v[2], v[3], "cylinder", markerSize, r, g, b, 255) 
end 
  
function attachBlips() 
    createBlipAttachedTo(marker, 56) 
 end 
 addEventHandler("onResourceStart", root, attachBlips) 
  

It attaches blips to only SF Airport Marker. LS and VM Airport Marker blips aren't getting attached but their marker is created. thank you

Link to comment

Here you go.

local pilot = { 
    {414.2, 2533.5, 18.1}, -- VM Airport 
    {1449.92236, -2287.12622, 12.3}, -- LS Airport 
    {-1226.55, 55.48, 13.13}, -- SF Airport 
} 
  
function attachBlips() 
    local markerSize = 1.5 
    local r, g, b = 255, 255, 0 
    for i,v in ipairs(pilot) do 
        local marker = createMarker(v[1], v[2], v[3], "cylinder", markerSize, r, g, b, 255) 
        local blip = createBlipAttachedTo(marker, 56) 
    end 
 end 
 addEventHandler("onResourceStart", root, attachBlips) 

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