Vehicle::isHeliPartBroken: Difference between revisions

From RAGE Multiplayer Wiki
(Added knowledge)
mNo edit summary
Line 30: Line 30:
}
}
if(veh.isHeliPartBroken(true, false, true)) {
if(veh.isHeliPartBroken(true, false, true)) {
// the main rotor or something related to the tail is broken
// the main rotor or the whole tail is broken
}
}
if(veh.isHeliPartBroken(false, true, true)) {
if(veh.isHeliPartBroken(false, true, true)) {

Revision as of 15:31, 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