Blip::getCoords: Difference between revisions
MrPancakers (talk | contribs) mNo edit summary |
m (Replaced HTML with template) |
||
| Line 1: | Line 1: | ||
Function to return the coordinates of the blip. | |||
== Syntax == | == Syntax == | ||
<pre> | |||
< | |||
blip.getCoords(); | blip.getCoords(); | ||
</ | </pre> | ||
=== Return Value === | === Return Value === | ||
| Line 11: | Line 10: | ||
== Examples == | == Examples == | ||
Retrieving the coordinates value from the blip called policeBlip | Retrieving the coordinates value from the blip called policeBlip | ||
{{ClientsideCode| | |||
< | <pre> | ||
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), | color: 3, | ||
shortRange: true, | |||
}); | }); | ||
| Line 26: | Line 22: | ||
mp.gui.chat.push("Coords: " + JSON.stringify(getBlipCoords)); | mp.gui.chat.push("Coords: " + JSON.stringify(getBlipCoords)); | ||
//Output: "Coords: {"x":407.95001220703125,"y":-961.0499877929688,"z":0}" | //Output: "Coords: {"x":407.95001220703125,"y":-961.0499877929688,"z":0}" | ||
</ | </pre> | ||
}} | |||
==See also== | ==See also== | ||
Revision as of 13:08, 26 October 2018
Function to return the coordinates 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
- Functions
- Properties