Vehicle::getDriftTyresEnabled: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "{{JSContainer| === Required Arguments === *'''handle:''' Vehicle handle ===Return value=== *'''void''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.vehicle.getDriftTyresEnabled(handle); </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> const vehicle = mp.vehicles.atRemoteId(0); //get vehicle with remote id 0 if (!vehicle || !mp.vehicles.exists(vehicle)) return; //if the vehicle don't exist we return here //Vehicle is valid, processing the...")
 
(fix return value)
 
Line 5: Line 5:
   
   
===Return value===
===Return value===
*'''void'''
*'''boolean'''


==Syntax==
==Syntax==

Latest revision as of 17:06, 22 April 2024

JavaScript Syntax


Required Arguments

  • handle: Vehicle handle

Return value

  • boolean

Syntax

mp.game.vehicle.getDriftTyresEnabled(handle);

Example

const vehicle = mp.vehicles.atRemoteId(0); //get vehicle with remote id 0
if (!vehicle || !mp.vehicles.exists(vehicle)) return; //if the vehicle don't exist we return here
//Vehicle is valid, processing the code:
const driftTyres = mp.game.vehicle.getDriftTyresEnabled(vehicle.handle);
mp.console.logWarning(`Vehicle ${driftTyres ? 'has' : 'does not have'} drift tyres enabled.`)


See also