Blip::getCoords: Difference between revisions

From RAGE Multiplayer Wiki
(Added example, fixed blip definition & changed layout)
mNo edit summary
Line 15: Line 15:


Retrieving the coordinates value from the blip called policeBlip
Retrieving the coordinates value from the blip called policeBlip
 
<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
let policeBlip = mp.blips.new(60, new mp.Vector3(407.95, -961.05, 0),
let policeBlip = mp.blips.new(60, new mp.Vector3(407.95, -961.05, 0),
Line 28: Line 29:
//Output: "Coords: {"x":407.95001220703125,"y":-961.0499877929688,"z":0}"
//Output: "Coords: {"x":407.95001220703125,"y":-961.0499877929688,"z":0}"
</syntaxhighlight>
</syntaxhighlight>
</div>


==See also==
==See also==

Revision as of 11:14, 11 May 2018

Client-Side

Property to return the coordinates value of the blip.

Syntax

blip.getCoords();

Return Value

  • Vector3

Examples

Retrieving the coordinates value from the blip called policeBlip

Client-Side
let policeBlip = mp.blips.new(60, new mp.Vector3(407.95, -961.05, 0),
    {
        color: 3,
        shortRange: true,
});

let getBlipCoords = policeBlip.getCoords();

mp.gui.chat.push("Coords: " + JSON.stringify(getBlipCoords));
//Output: "Coords: {"x":407.95001220703125,"y":-961.0499877929688,"z":0}"

See also