Blip::routeFor: Difference between revisions
mNo edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Function''': creates a route to blip from the player(s). | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="javacript"> | ||
blip.routeFor(Player player, int | blip.routeFor(Player player, int color, float scale); | ||
blip.routeFor(Player[] players, int | blip.routeFor(Player[] players, int color, float scale); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''player(s):''' Array or object of player to which to apply route | *'''player(s):''' Array or object of player to which to apply route | ||
*''' | *'''color:''' ID colour. ''(All colors available on [[Blips#Blip_colors|Blip Colors]] page)'' | ||
*'''scale:''' Blip route scale | *'''scale:''' Blip route scale | ||
| Line 15: | Line 15: | ||
That's example will create command for creating blip and add route to the player who entered it: | That's example will create command for creating blip and add route to the player who entered it: | ||
{{ServerSide}} | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
mp.events.addCommand("routeBlip", (player) => { | mp.events.addCommand("routeBlip", (player) => { | ||
| Line 25: | Line 24: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Blip_definition}} | ||
Revision as of 14:31, 28 December 2017
Function: creates a route to blip from the player(s).
Syntax
blip.routeFor(Player player, int color, float scale);
blip.routeFor(Player[] players, int color, float scale);Required Arguments
- player(s): Array or object of player to which to apply route
- color: ID colour. (All colors available on Blip Colors page)
- scale: Blip route scale
Example
That's example will create 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