Exports & API
legends_blips does not expose public exports. All functionality is accessed through commands and the in-game menu.
Overview
This resource operates through its own internal systems and FiveM's ACE permission framework. Blip management is handled through events between client and server.
Commands
All commands require the legends_blips.manage ACE permission.
/manageblips
Opens the main blip management menu.
/manageblipsMenu Options:
- Create New Blip
- Refresh All Blips
- Manage Existing Blips
- Settings
/refreshblips
Manually refreshes all blips from the config file.
/refreshblipsUseful after manually editing config.json or when blips aren't displaying correctly.
/debugconfig
Shows the current configuration state in the F8 console.
/debugconfigOutputs:
- Number of normal blips
- Number of area blips
- Number of closest-only blips per category
Events
Client Events
These events are triggered by the server after permission verification.
legends_blips:openMenu
Opens the blip management menu on the client.
-- Triggered internally by server after permission check
RegisterNetEvent('legends_blips:openMenu', function()
-- Opens the ox_lib context menu
end)legends_blips:refreshBlips
Triggers a complete blip refresh on the client.
RegisterNetEvent('legends_blips:refreshBlips', function()
-- Clears and recreates all blips
end)legends_blips:debugConfig
Outputs debug information to the client console.
RegisterNetEvent('legends_blips:debugConfig', function()
-- Prints config state to F8 console
end)Server Events
legends_blips:saveBlip
Saves a new blip to the config file.
TriggerServerEvent('legends_blips:saveBlip', blipData)blipData structure:
{
name = "Blip Name",
coords = {x, y, z},
sprite = 1,
color = 2,
scale = 0.8,
type = "normal", -- or "area" or "closest"
radius = 100.0, -- for area blips only
category = "ATM" -- for closest blips only
}legends_blips:editBlip
Edits an existing blip.
TriggerServerEvent('legends_blips:editBlip', blipType, blipIndex, newBlipData, category)Parameters:
blipType- "normal", "area", or "closest"blipIndex- Array index of the blipnewBlipData- Updated blip propertiescategory- Category name (for closest blips only)
legends_blips:deleteBlip
Deletes a blip from the config.
TriggerServerEvent('legends_blips:deleteBlip', blipType, blipIndex, category)ACE Permission
The resource uses a single permission for all management functions:
legends_blips.manageChecking Permission (Server-side)
if IsPlayerAceAllowed(source, "legends_blips.manage") then
-- Player has permission
endSetting Up Permissions
Add to server.cfg:
# For individual players
add_ace identifier.license:abc123 legends_blips.manage allow
# For groups
add_ace group.admin legends_blips.manage allowConfig File Structure
The JSON config is stored at config/config.json:
{
"EnableDebug": false,
"updateCooldown": 10000,
"blips": [
{
"name": "string",
"coords": [0.0, 0.0, 0.0],
"sprite": 1,
"color": 0,
"scale": 0.8
}
],
"areaBlips": [
{
"name": "string",
"coords": [0.0, 0.0, 0.0],
"sprite": 1,
"color": 0,
"scale": 0.8,
"radius": 100.0
}
],
"closestOnlyBlips": {
"CategoryName": [
{
"name": "string",
"coords": [0.0, 0.0, 0.0],
"sprite": 1,
"color": 0,
"scale": 0.8
}
]
}
}Integration Examples
Adding Blips Programmatically
If you need to add blips from another resource, you can modify the config file directly:
-- Server-side: Read, modify, and save config
local configFile = LoadResourceFile('legends_blips', 'config/config.json')
local config = json.decode(configFile)
-- Add a new blip
table.insert(config.blips, {
name = "New Location",
coords = {100.0, 200.0, 30.0},
sprite = 1,
color = 2,
scale = 0.8
})
-- Save config
SaveResourceFile('legends_blips', 'config/config.json', json.encode(config, {indent = true}), -1)
-- Trigger refresh for all clients
TriggerClientEvent('legends_blips:refreshBlips', -1)Modifying the config file directly bypasses permission checks. Only use this approach in trusted server-side code.
Checking if Resource is Running
local function isBlipsResourceRunning()
return GetResourceState('legends_blips') == 'started'
endTechnical Notes
Closest Blips Thread
The closest-only blips system runs on a configurable interval:
- Default: 10 seconds (
updateCooldown: 10000) - Calculates player distance to all blips in each category
- Shows only the nearest blip per category
- Updates automatically as player moves
Performance Considerations
- Normal and area blips are created once on resource start
- Closest blips are updated every
updateCooldownmilliseconds - Higher cooldown = better performance but less responsive
- Recommended range: 5000-15000ms
File Permissions
The server needs write access to config/config.json for the in-game editor to save changes.
Need Help?
Join our Discord for support: discord.gg/lgnds (opens in a new tab)