Blip::routeFor: Difference between revisions
MrPancakers (talk | contribs) m (Fixed up page, better description & example) |
m (Replaced HTML with template) |
||
| Line 6: | Line 6: | ||
blip.routeFor(player, color, scale); | blip.routeFor(player, color, scale); | ||
</pre> | </pre> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''player:'''' Player object or an array of player objects | *'''player:'''' Player object or an array of player objects | ||
| Line 14: | Line 15: | ||
This example will create a command for creating blip and add route to the player who entered it: | This example will create a command for creating blip and add route to the player who entered it: | ||
{{ServersideCode| | |||
<pre> | <pre> | ||
mp.events.addCommand("routeBlip", (player) => { | mp.events.addCommand("routeBlip", (player) => { | ||
| Line 24: | Line 24: | ||
}); | }); | ||
</pre> | </pre> | ||
}} | |||
==See Also== | ==See Also== | ||
{{Blip_definition}} | {{Blip_definition}} | ||
Revision as of 12:07, 26 October 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