Add Blip

This endpoint allows you to add a new custom blip to your community's live map!

This API endpoint requires the pro version of Sonoran CAD or higher. For more information, see our pricing page.

This framework export handles the Add Blip API endpoint.

function addBlip(coords, colorHex, subType, toolTip, icon, dataTable, cb)
    local data = {{
        ["serverId"] = GetConvar("sonoran_serverId", 1),
        ["blip"] = {
            ["id"] = -1,
            ["subType"] = subType,
            ["coordinates"] = {
                ["x"] = coords.x,
                ["y"] = coords.y
            },
            ["icon"] = icon,
            ["color"] = colorHex,
            ["tooltip"] = toolTip,
            ["data"] = dataTable
        }
    }}
    exports["sonorancad"]:performApiRequest(data, "ADD_BLIP", function(res)
        if cb ~= nil then
            cb(res)
        end
    end)
end

Parameters

Property
Type
Description

coords

vector2

Coordinates of the blip on the map

colorHex

String

Color hex of the blip

subType

String

Blip subtype

toolTip

String

Blip tooltip

icon

String

dataTable

Table

{{title = 'TITLE', text = 'TEXT'}}

cb

Function

OPTIONAL: Callback function

Last updated