Blip::routeFor: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__TOC__
This function used for create route to blip for player.
{{ServersideJsFunction}}


Creates a route to the blip from the player's location.
{{JSContainer|
==Syntax==
==Syntax==
<syntaxhighlight lang="typescript">
<pre>
blip.routeFor(Player player, int colour, float scale);
blip.routeFor(player, color, scale);
blip.routeFor(Player[] players, int colour, float scale);
</pre>  
</syntaxhighlight>  
 
===Required Arguments===
===Required Arguments===
*'''player(s):''' Array or object of player to which to apply route
*'''player:'''' Player object or an array of player objects
*'''colour:''' ID colour. ''(All colours available on [[Blips#Blip_colours|Blip Colours]] page)''
*'''color:''' {{RageType|Int}} ''(All colors available on [[Blips#Blip_colors|Blip Colors]] page)''
*'''scale:''' Blip route scale
*'''scale:''' {{RageType|Float}}


==Example==  
==Example==  
That's example will create 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:


<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;">
{{ServersideCode|
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div>
<pre>
<syntaxhighlight lang="javascript">
mp.events.addCommand("routeBlip", (player) => {
mp.events.addCommand("routeBlip", (player) => {
const position = player.position;
const position = player.position;
Line 24: Line 26:
blip.routeFor(player, 2, 1);
blip.routeFor(player, 2, 1);
});
});
</syntaxhighlight>
</pre>
</div>
}}
}}


==See Also==
==See Also==
{{Blip_function}}
{{Blip_definition}}

Latest revision as of 12:17, 2 December 2019

Server-Side
Function

 JavaScript



Creates a route to the blip from the player's location.

JavaScript Syntax

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