Checkpoint::getColor: Difference between revisions

From RAGE Multiplayer Wiki
m (Adding the ServerSide header template)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Returns an array of 4 numbers, with a checkpoint color
'''Function''': Returns an array of 4 numbers, with a checkpoint color
==Return==
==Return==
* '''<span style="color:#008017>Array<Number></span>'''
* {{RageType|Array<Number>}}


==Example==
==Example==
{{ServerSide}}
{{ServersideCode|
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
const checkpoint = mp.checkpoints.new(2, new mp.Vector3(10, 10, 72), new mp.Vector3(), 4, 150, 255, 255, 255, true);
const checkpoint = mp.checkpoints.new(2, new mp.Vector3(10, 10, 72), new mp.Vector3(), 4, 150, 255, 255, 255, true);
const colour = checkpoint.getColour();
const color = checkpoint.getColor();


console.log(colour); // -> [150, 255, 255, 255]
console.log(color); // -> [150, 255, 255, 255]
console.log(colour[0]); // -> 150
console.log(color[0]); // -> 150
</syntaxhighlight>
</syntaxhighlight>
}}


==See Also==
[[Category:Checkpoint API]]
{{Checkpoint_function}}
[[Category:Server-side Function]]

Latest revision as of 16:51, 17 May 2019

Function: Returns an array of 4 numbers, with a checkpoint color

Return

  • Array<Number>

Example

Server-Side
const checkpoint = mp.checkpoints.new(2, new mp.Vector3(10, 10, 72), new mp.Vector3(), 4, 150, 255, 255, 255, true);
const color = checkpoint.getColor();

console.log(color); // -> [150, 255, 255, 255]
console.log(color[0]); // -> 150