Vehicle::getColor: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(Change to correct function.)
Line 1: Line 1:


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.getColor(r, g, b);</syntaxhighlight>
<syntaxhighlight lang="javascript">vehicle.getColor(id);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''r:''' int
*'''id:''' int
*'''g:''' int
*'''b:''' int
===Return value===
===Return value===
*'''object:''' r, g, b
*'''integer:''' colour
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let primaryColor = player.vehicle.getColor(0)
let secondaryColor = player.vehicle.getColor(1)
 
// If the vehicle primary color was black the following would return 0
console.log(primaryColor)
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==

Revision as of 19:49, 14 August 2018

Syntax

vehicle.getColor(id);

Required Arguments

  • id: int

Return value

  • integer: colour

Example

let primaryColor = player.vehicle.getColor(0)
let secondaryColor = player.vehicle.getColor(1)

// If the vehicle primary color was black the following would return 0
console.log(primaryColor)

See also