esx_core
esx_core copied to clipboard
feat(es_extended/client/imports): Blip Helper Class
Description
Adds a Blip Creation Class, to make blip creation easier, look nicer and feel better
Motivation
Its a cool and useful feature to have
Implementation Details
Add a class that is available with either require , or with the ESX Import using ESX.Blip
Usage Example
local coord = Vector3(0, 0, 0) -- x, y, z
local entity = PlayerPedId() -- number for entity
local radius = vector4(0,0,0, 5) -- x, y, z, radius
local area = {x = 0, y = 0, z = 0, width = 5, height = 5} -- table for area
local coordBlip = ESX.Blip:new(coord, "Safe House", 40, 0.8, 11, true) -- create a new blip
coordBlip:create() -- creates the blip on the map
coordBlip:setColour(3) -- change colour
local entityBlip = ESX.Blip:new(entity, "Police Car ", 56, 0.8, 11, true) -- create a new blip
entityBlip:create() -- creates the blip on the map
entityBlip:setLabel("Off Duty Police Car") -- change blip label
local radiusBlip = ESX.Blip:new(radius , "Mystery Area", 9, 0.5, 2, true) -- create a new blip
coordBlip:create() -- creates the blip on the map
coordBlip:setScale(1.0) -- change scale
local areaBlip = ESX.Blip:new(area, "Mystery Area", 9, 0.5, 2, true) -- create a new blip
areaBlip:create() -- creates the blip on the map
areaBlip:setShortRange(false) -- change showing as short Range
areaBlip:setDisplay(5) -- change display setttings (5 to only show on minmap, for example)
--- Cleanup
coordBlip:delete()
entityBlip:delete()
coordBlip:delete()
areaBlip:delete()
PR Checklist
- [x] My commit messages and PR title follow the Conventional Commits standard.
- [x] My changes have been tested locally and function as expected.
- [x] My PR does not introduce any breaking changes.
- [x] I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.