fivem scripting how to create a marker
- User
fivem scripting how to create a marker
- Assistant
To create a marker in FiveM, you can use the
CreateMarkerfunction.Here is an example of a basic marker:
local marker = CreateMarker(1, 0, 0, 0, 0, 0, 0, 0, 0, 1.5, 1.5, 1.5, 255, 0, 0, 200, false, true, 2, false, false, false, false) Citizen.CreateThread(function() while true do Citizen.Wait(0) DrawMarker(1, marker.x, marker.y, marker.z, 0, 0, 0, 0, 0, 0, marker.scaleX, marker.scaleY, marker.scaleZ, marker.red, marker.green, marker.blue, marker.alpha, false, true, 2, false, false, false, false) end end)This will create a red marker with a size of 1.5x1.5x1.5 that is visible from a distance of 2 units. To change the color of the marker, you can adjust the
red,green,blue, andalphavalues.You can also add more properties to the marker, such as a label and an action when the player interacts with it. Check the FiveM documentation for more information on marker properties and functions.
- User
fivem scripting how to create a Blip
- Assistant
To create a blip in FiveM, you can use the
AddBlipForCoordorAddBlipForRadiusfunction.Here is an example of creating a blip for a coordinate:
local blip = AddBlipForCoord(x, y, z) SetBlipSprite(blip, sprite) SetBlipDisplay(blip, display) SetBlipScale(blip, scale) SetBlipColour(blip, color) SetBlipAsShortRange(blip, isShortRange) BeginTextCommandSetBlipName("STRING") AddTextComponentString(label) EndTextCommandSetBlipName(blip)This will create a blip at the specified coordinate with the specified properties. You can adjust the sprite, display, scale, color, and label properties as needed.
Here is an example of creating a blip for a radius:
local blip = AddBlipForRadius(x, y, z, radius) SetBlipSprite(blip, sprite) SetBlipDisplay(blip, display) SetBlipScale(blip, scale) SetBlipColour(blip, color) SetBlipAsShortRange(blip, isShortRange) BeginTextCommandSetBlipName("STRING") AddTextComponentString(label) EndTextCommandSetBlipName(blip)This will create a blip at the center of the specified radius with the specified properties. You can adjust the sprite, display, scale, color, and label properties as needed.
Note that blips created with are only visible on the minimap, not on the world map.