Blip
Example
------------------------------------------------------------------------------
-- Step 1: Get API
------------------------------------------------------------------------------
---@type NssLibsBlipsApi
local blip_api = exports.nss_libs:getBlipsApi(GetCurrentResourceName())
------------------------------------------------------------------------------
-- Step 2: Create blip object and show it
------------------------------------------------------------------------------
-- Create blip at coords
local icon = 'blip_ambient_vip'
local title = 'Treasure'
local color_hash = 0x1DD3A06B
local x = -760.56
local y = -1251.08
local z = 43.41
---@type NssLibsBlipApi
local coords_blip = blip_api.createAtCoords(x, y, z, icon, title, color_hash)
coords_blip.setMedium()
coords_blip.addModifier('BLIP_MODIFIER_MP_SUPPLIES_OUTLINE_COLOR_2') -- Adds red outline
coords_blip.show()
-- Create blip at entity
local entity = GetPlayerPed(-1)
local color_name = 'BLIP_MODIFIER_MP_COLOR_4' -- names working, too
---@type NssLibsBlipApi
local entity_blip = blip_api.createAttachedToEntity(entity, icon, title, color_name)
entity_blip.setSmall()
entity_blip.show()
------------------------------------------------------------------------------
-- Optional: Dynamic changes
------------------------------------------------------------------------------
entity_blip.setColor(0x6F85C3CE) -- blip will be reassembled with new color.
------------------------------------------------------------------------------
-- Step 3: Hide blip
------------------------------------------------------------------------------
-- If you want to remove the blip completely, use destroy() instead of hide().
coords_blip.hide()
entity_blip.hide()Methods
exports.nss_libs:getBlipsApi(resource_name)
exports.nss_libs:getBlipsApi(resource_name)NssLibsBlipsApi
NssLibsBlipsApicreate(icon, title, color)
create(icon, title, color)createAtCoords(x, y, z, icon, color, title)
createAtCoords(x, y, z, icon, color, title)createAttachedToEntity(entity, icon, color, title)
createAttachedToEntity(entity, icon, color, title)createRadiusAtCoords(x, y, z, range, color)
createRadiusAtCoords(x, y, z, range, color)NssLibsBlipApi
NssLibsBlipApidestroy()
destroy()show()
show()hide()
hide()setCoords(x, y, z)
setCoords(x, y, z)setEntity(entity)
setEntity(entity)setRadius(x, y, z, range)
setRadius(x, y, z, range)setColor(color)
setColor(color)setTitle(title)
setTitle(title)setIcon(icon)
setIcon(icon)setSmall()
setSmall()setMedium()
setMedium()setBig()
setBig()isVisible()
isVisible()addModifier(modifier)
addModifier(modifier)Todos
Last updated
Was this helpful?