Blip::getCoords: Difference between revisions
No edit summary |
MrPancakers (talk | contribs) (Added example, fixed blip definition & changed layout) |
||
| Line 1: | Line 1: | ||
{{ClientSide}} | |||
==Syntax== | Property to return the coordinates value of the blip. | ||
<syntaxhighlight lang="javascript">blip.getCoords();</syntaxhighlight> | |||
===Return | == Syntax == | ||
<syntaxhighlight lang="javascript"> | |||
blip.getCoords(); | |||
</syntaxhighlight> | |||
=== Return Value === | |||
*'''Vector3''' | *'''Vector3''' | ||
== | |||
== Examples == | |||
Retrieving the coordinates value from the blip called policeBlip | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// | 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}" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{ | {{Blip_definition}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:Blip API]] | [[Category:Blip API]] | ||
Revision as of 11:13, 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
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