Client
Blip Class
Import
Before use the class and its functions you must import the file in the script where you want to use it in this way:
-- OTHER CODE --
lua54 'yes'
-- OTHER CODE --
client_scripts {
'@mnr_blips/init.lua',
-- 'client/*.lua'
}
-- OTHER CODE --Blip Constructor
The blip can be created in this way:
local blip = Blip:new({
label = "Example Blip",
coords = vec3(0.0, 0.0, 0.0),
display = 2,
sprite = 93,
color = 0,
alpha = 255,
scale = 0.8,
})Constructor Parameters
-
Blip Options:
table-
label?:
stringThe name of the blip displayed on the map. -
coords:
vector3Position where the blip will appear. -
display?:
number(default: 2) Visibility settings:- 0 = Hidden
- 2 = Map & Minimap (Selectable)
- 3 = Map Only
- 5 = Minimap Only
- 8 = Map & Minimap (Not Selectable)
-
sprite?:
numberIcon of the blip. (See FiveM blip list) -
color?:
numberColor of the blip. -
alpha?:
numberTransparency (0 = transparent, 255 = opaque) -
scale?:
numberSize of the blip (e.g. 0.8 = smaller) -
range?:
boolean(default: true) If enabled, blip appears only when the player is nearby.
-
Methods
Blip:label()
Changes the label of an existing blip.
blip:label("New Blip Name")Parameters:
text:string— The new label to display.
Blip:move()
Moves the blip to new coordinates, useful when updating dynamic objects or tracking moving entities.
Blip:move(vec3(200.0, 200.0, 200.0))Parameters:
coords:vector3— New position.
Blip:delete()
Removes the blip from the map, once deleted, the blip handle becomes nil and the object can be deleted.
Blip:delete()