- Documentation
- Shared functions
- createBlipAttachedTo
Function
createBlipAttachedTo
Creates a blip attached to an element. The blip moves with it, for example with a vehicle or player.
Syntax
blip createBlipAttachedTo(element element [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 16383])Arguments
elementelement- The element the blip follows.
iconint, optional = 0- Icon number.
sizeint, optional = 2- Square size.
rint, optional = 255- Colour: red.
gint, optional = 0- Colour: green.
bint, optional = 0- Colour: blue.
aint, optional = 255- Opacity.
orderingint, optional = 0- Draw order.
visibleDistancefloat, optional = 16383- Radar visibility range.
Differences from MTA:SA
- These MTA:SA arguments are not here:
element visibleTo = getRootElement()
In MTA:SA
createBlipAttachedTo(element elementToAttachTo, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 16383.0, element visibleTo = getRootElement())Returns
The new blip or false.
Example
local vehicle = createVehicle(411, 2495.0, -1680.0, 13.4)
createBlipAttachedTo(vehicle, 0, 2, 255, 200, 0)
See also
createBlipCreates a blip, an icon on the radar and map, at the given point.attachElementsAttaches an element to another. The attached element moves and rotates together with the one it is attached to. An object attached to a vehicle is carried by the game in the same frame as the vehicle physics, so it stays exactly in place even at high speed and in turns.