Vehicle::isHeliPartBroken

From RAGE Multiplayer Wiki
Revision as of 15:33, 17 February 2019 by Meta (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Returns if any of the heli parts selected as boolean arguments is broken (they pretty much work like bit flags).

Client-Side
Function

 JavaScript



JavaScript Syntax

Syntax

vehicle.isHeliPartBroken(mainRotor, tailRotor, tail);

Required Arguments

  • mainRotor: Boolean
  • tailRotor: Boolean
  • tail: Boolean

Return value

  • Boolean - if anything matching your selection is broken.

Note: If the tail is broken, the tail rotor is broken too!

Example

const veh = mp.players.local.vehicle

if(veh.isHeliPartBroken(true, false, false)) { /* main rotor is broken */}
if(veh.isHeliPartBroken(false, true, false)) { /* tail rotor is broken */}
if(veh.isHeliPartBroken(false, false, true)) { /* the whole tail is ripped off */}

if(veh.isHeliPartBroken(true, true, false)) { /* any of the rotors are broken */}
if(veh.isHeliPartBroken(true, false, true)) { /* the main rotor or the whole tail is broken */}
if(veh.isHeliPartBroken(false, true, true)) { /* something related to the tail is broken */}

if(veh.isHeliPartBroken(true, true, true)) { /* something is broken, you just don't know what. */ }


See also