A comprehensive standalone blip manager designed to streamline the creation, management, and manipulation of blips in your projects. It provides a robust set of functions for creating, updating, toggling, and removing blips.
Functions
create_blip
Creates a new blip.
--- Define blip data
local blip = {
coords = vector3(100.0, 200.0, 30.0), -- Coordinates
sprite = 1, -- Sprite ID
color = 2, -- Color ID
scale = 0.8, -- Scale
label = "Shop", -- Label
category = "shops" -- Category
}
--- Utils object
utils.blips.create_blip(blip)
--- Direct export
exports.boii_utils:create_blip(blip)
--- Define blip ID
local blip = 'your blip id'
--- Utils object
utils.blips.remove_blip(blip)
--- Direct export
exports.boii_utils:remove_blip(blip)
remove_all_blips
Remove all blips.
--- Utils object
utils.blips.remove_all_blips()
--- Direct export
exports.boii_utils:remove_all_blips()
remove_blips_by_category
Remove blips by specified category.
--- Specify the category to remove
local category = 'shops'
--- Utils object
utils.blips.remove_blips_by_category(category)
--- Direct export
exports.boii_utils:remove_blips_by_category(category)
toggle_blips_by_category
Toggle blip visibility by category.
--- Define category
local category = 'shops'
--- Set to true to show, false to hide
local state = true
--- Utils object
utils.blips.toggle_blips_by_category(category, state)
--- Direct export
exports.boii_utils:toggle_blips_by_category(category, state)
update_blip_property
Update properties of a blip.
--- Define blip ID
local blip = 'your blip id'
--- Specify propert to update; (label, sprite, color, scale)
local property = 'label'
--- Define value for the property
local value = 'New Label'
--- Utils object
utils.blips.update_blip_property(blip, property, value)
--- Direct export
exports.boii_utils:update_blip_property(blip, property, value)
get_all_blips
Gets all blips in created_blips table.
--- Utils object
local blips = utils.blips.get_all_blips()
print("Blips:", json.encode(blips))
--- Direct export
local blips = exports.boii_utils:get_all_blips()
print("Blips:", json.encode(blips))
get_blips_by_category
Get blips by specified category.
--- Specify category to get
local category = 'shops'
--- Utils object
local blips = utils.blips.get_blips_by_category(category)
print("Blips in category 'shops':", json.encode(blips))
--- Direct export
local blips = exports.boii_utils:get_blips_by_category(category)
print("Blips in category 'shops':", json.encode(blips))