Blip::routeFor: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
This function used for create route to blip for player.
'''Function''': creates a route to blip from the player(s).


==Syntax==
==Syntax==
<syntaxhighlight lang="typescript">
<syntaxhighlight lang="javacript">
blip.routeFor(Player player, int colour, float scale);
blip.routeFor(Player player, int color, float scale);
blip.routeFor(Player[] players, int colour, float scale);
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  
*'''colour:''' ID colour. ''(All colours available on [[Blips#Blip_colours|Blip Colours]] page)''
*'''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:


<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServerSide}}
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.events.addCommand("routeBlip", (player) => {
mp.events.addCommand("routeBlip", (player) => {
Line 25: Line 24:
});
});
</syntaxhighlight>
</syntaxhighlight>
</div>


==See Also==
==See Also==
{{Blip_function}}
{{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