Blip::routeFor: Difference between revisions
(→Syntax) |
MrPancakers (talk | contribs) m (Fixed up page, better description & example) |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Creates a route to the blip from the player's location. | |||
==Syntax== | ==Syntax== | ||
< | <pre> | ||
blip.routeFor(player, color, scale); | |||
</pre> | |||
</ | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''player | *'''player:'''' Player object or an array of player objects | ||
*'''color:''' | *'''color:''' {{RageType|Int}} ''(All colors available on [[Blips#Blip_colors|Blip Colors]] page)'' | ||
*'''scale:''' | *'''scale:''' {{RageType|Float}} | ||
==Example== | ==Example== | ||
This example will create a command for creating blip and add route to the player who entered it: | |||
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;"> | |||
< | <div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div> | ||
<pre> | |||
mp.events.addCommand("routeBlip", (player) => { | mp.events.addCommand("routeBlip", (player) => { | ||
const position = player.position; | const position = player.position; | ||
| Line 23: | Line 23: | ||
blip.routeFor(player, 2, 1); | blip.routeFor(player, 2, 1); | ||
}); | }); | ||
</ | </pre> | ||
</div> | |||
==See Also== | ==See Also== | ||
{{Blip_definition}} | {{Blip_definition}} | ||
Revision as of 01:41, 29 September 2018
Creates a route to the blip from the player's location.
Syntax
blip.routeFor(player, color, scale);
Required Arguments
- player:' Player object or an array of player objects
- color: Int (All colors available on Blip Colors page)
- scale: Float
Example
This example will create a command for creating blip and add route to the player who entered it:
Server-Side
mp.events.addCommand("routeBlip", (player) => {
const position = player.position;
const blip = mp.blips.new(1, position);
blip.routeFor(player, 2, 1);
});
See Also
- Functions
- Properties