Blips

CLIENT SIDE ONLY

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)

create_blips

Create multiple blips from a single table.

--- Define blips
local blips = {
    {
        coords = vector3(100.0, 200.0, 30.0),
        sprite = 1,
        color = 2,
        scale = 0.8,
        label = "Shop 1",
        category = "shops"
    },
    {
        coords = vector3(150.0, 250.0, 35.0),
        sprite = 2,
        color = 3,
        scale = 0.8,
        label = "Shop 2",
        category = "shops"
    }
}

--- Utils object
utils.blips.create_blips(blips)

--- Direct export
exports.boii_utils:create_blips(blips)

remove_blip

Remove a single 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))

Last updated