Blips

The utility library blip manager provides functionality for creating, managing, and controlling blips.

The blip manager is client side only.

Functions

Below is a list of all the available functions related to blips which can be accessed through the utils object.

utils.blips.create_blip = create_blip
utils.blips.create_blips = create_blips
utils.blips.remove_all_blips = remove_all_blips
utils.blips.remove_blips_by_categories = remove_blips_by_categories
utils.blips.toggle_all_blips = toggle_all_blips
utils.blips.toggle_blips_by_category = toggle_blips_by_category
utils.blips.create_blip_alpha = create_blip_alpha
utils.blips.update_blip_label = update_blip_label
utils.blips.update_blip_sprite = update_blip_sprite
utils.blips.update_blip_colour = update_blip_colour
utils.blips.update_blip_scale = update_blip_scale
utils.blips.are_blips_enabled = are_blips_enabled
utils.blips.get_category_state = get_category_state
utils.blips.get_all_blips = get_all_blips
utils.blips.get_blips_by_category = get_blips_by_category
utils.blips.get_blip_label = get_blip_label

create_blip

Creates a single blip and adds it to the created_blips table.

--- Utils object
utils.blips.create_blip({ 
    coords = vector3(100.0, 200.0, 30.0), 
    sprite = 1, 
    colour = 1, 
    scale = 1.5, 
    label = 'Blip 1', 
    category = 'shop', 
    show = true 
})

--- Export
exports.boii_utils:blips_create_blip({ 
    coords = vector3(100.0, 200.0, 30.0), 
    sprite = 1, 
    colour = 1, 
    scale = 1.5, 
    label = 'Blip 1', 
    category = 'shop', 
    show = true 
})

create_blips

Can be used to create multiple blips instead of calling create_blip individually.

local blips = {
    { 
        coords = vector3(100.0, 200.0, 30.0), 
        sprite = 1, 
        colour = 1, 
        scale = 1.5, 
        label = 'Blip 1', 
        category = 'shop', 
        show = true 
    },
    -- Add more blips as needed
}

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

--- Export
exports.boii_utils:blips_create_blips(blips)

remove_all_blips

Removes all blips created by the blip manager functions.

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

--- Export
exports.boii_utils:blips_remove_all_blips()

remove_blips_by_categories

Removes specific categorized blips.

--- Utils object
utils.blips.remove_blips_by_categories({'shop', 'house'})

--- Export
exports.boii_utils:blips_remove_blips_by_categories({'shop', 'house'})

toggle_all_blips

Can be used to toggle the visibility of all blips created by the manager.

--- Show blips
--- Utils object
utils.blips.toggle_all_blips(true)

--- Export
exports.boii_utils:blips_toggle_all_blips(true)

--- Hide blips
--- Utils object
utils.blips.toggle_all_blips(false)

--- Export
exports.boii_utils:blips_toggle_all_blips(false)

toggle_blips_by_category

Can be used to toggle visibility of specific categorised blips.

-- Utils object
utils.blips.toggle_blips_by_category('shop', false)

--- Export
exports.boii_utils:blips_toggle_blips_by_category('shop', false)

create_blip_alpha

Create a blip with alpha and duration management, this can be used for creating temporary alert blips, or vehicle tracking blips etc.

--- Utils object
utils.blips.create_blip_alpha({
    coords = vector3(100.0, 200.0, 30.0),
    sprite = 161,
    colour = 1, 
    scale = 1.5, 
    label = 'Example Blip',
    alpha = 250,
    duration = 10,
    colour_palette = {1, 3}
})

--- Export
exports.boii_utils:blips_create_blip_alpha({
    coords = vector3(100.0, 200.0, 30.0),
    sprite = 161,
    colour = 1, 
    scale = 1.5, 
    label = 'Example Blip',
    alpha = 250,
    duration = 10,
    colour_palette = {1, 3}
})

update_blip_label

Can be used to update the label of a specific blip.

--- Utils object
utils.blips.update_blip_label(blip, 'New Label')

--- Export
exports.boii_utils:blips_update_blip_label(blip, 'New Label')

update_blip_sprite

Can be used to update a blip sprite of a specific blip.

--- Utils object
utils.blips.update_blip_sprite(blip, 162)

--- Export
exports.boii_utils:blips_update_blip_sprite(blip, 162)

update_blip_colour

Can be used to update a blips colour of a specific blip.

--- Utils object
utils.blips.update_blip_colour(blip, 2)

--- Export
exports.boii_utils:blips_update_blip_colour(blip, 2)

update_blip_scale

Can be used to update the scale of a specific blip.

--- Utils object
utils.blips.update_blip_scale(blip, 2.0)

--- Export
exports.boii_utils:blips_update_blip_scale(blip, 2.0)

are_blips_enabled

Returns a boolean value to indicate if blips are enabled or not.

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

--- Export
exports.boii_utils:blips_are_blips_enabled()

get_category_state

Can be used to return the visibility state of a specified category.

--- Utils object
utils.blips.get_category_state('shop')

--- Export
exports.boii_utils:blips_get_category_state('shop')

get_all_blips

Can be used to return all of the blips thats have been created by the manager.

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

--- Export
exports.boii_utils:blips_get_all_blips()  

get_blips_by_category

Can be used to retrieve all blips in a specified category.

--- Utils object
utils.blips.get_blips_by_category('shop')

--- Export
exports.boii_utils:blips_get_blips_by_category('shop')

get_blip_label

Can be used to return the label of a specified blip.

--- Utils object
utils.blips.get_blip_label(blip)

--- Export
exports.boii_utils:blips_get_blip_label(blip)

Last updated