SetVehicleDisablePetrolTankDamage

From GT-MP
Jump to: navigation, search
SetVehicleDisablePetrolTankDamage
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

Allows/disallows the specified vehicle's petrol tank taking damage.

Dialog-warning.png Note: This feature is currently not in the API, or is currently not accurate on the wiki due to upcoming API changes. New API functions and changes will be released with the next update.


Dialog-warning.png

Note: The changed status will be set to default (disabled) after the vehicle streams out, so using this API in onEntityStreamIn is required!

Syntax

In Javascript
Client-Side Function

API.setVehicleDisablePetrolTankDamage(LocalHandle vehicle, bool toggle);

Required Arguments

  • vehicle parameter input should be in LocalHandle type.
  • toggle parameter input should be in bool type.

Usage example

Allows all vehicles to take petrol tank damage.

In Javascript
Client-Side Function

API.onEntityStreamIn.connect((ent, entType) => {
  if (entType === 1) { // Vehicle
    API.setVehicleDisablePetrolTankDamage(ent, false);
  }
});

References