Vehicle::isHeliPartBroken: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
mNo edit summary
 
Line 16: Line 16:
const veh = mp.players.local.vehicle
const veh = mp.players.local.vehicle


if(veh.isHeliPartBroken(true, false, false)) {
if(veh.isHeliPartBroken(true, false, false)) { /* main rotor is broken */}
// 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(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)) {
if(veh.isHeliPartBroken(true, true, false)) { /* any of the rotors are broken */}
// 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, 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)) {
if(veh.isHeliPartBroken(true, true, true)) { /* something is broken, you just don't know what. */ }
// something is broken, you just don't know what.
}
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 15:33, 17 February 2019

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