Vehicle::setExtra: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Note: only some vehicle have extras<br>extra ids are from 1 - 9 depending on the vehicle<br><br>-------------------------------------------------<br><br>^ not sure if outdated or simply wrong. Max extra ID for b944 is 14<br><br>-------------------------------------------------<br>p2 is not a on/off toggle. mostly 0 means on and 1 means off.<br>not sure if it really should be a BOOL.
Max extra ID is 16.
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.setExtra(extraId, toggle);</syntaxhighlight>
<syntaxhighlight lang="javascript">vehicle.setExtra(extraId, disabled);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''extraId:''' int
*'''extraId:''' {{RageType|int}}
*'''toggle:''' int
*'''disabled:''' {{RageType|boolean}}
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const vehicle = mp.players.local.vehicle;
if(vehicle) {
  vehicle.setExtra(1, false); // Enable extra 1
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==

Latest revision as of 15:56, 30 March 2021

Max extra ID is 16.

Syntax

vehicle.setExtra(extraId, disabled);

Required Arguments

  • extraId: int
  • disabled: boolean

Return value

  • Undefined

Example

const vehicle = mp.players.local.vehicle;
if(vehicle) {
  vehicle.setExtra(1, false); // Enable extra 1
}

See also