Arma 3 Scripting

Command in Object Manipulation

fuel

Also available as Markdown and JSON, or read the original wiki page.

Description

Checks how much fuel is left in the gas tank of a vehicle.

Syntax

fuel vehicle

Parameters:

Returns: Number in range 0..1 - 0 (empty tank) to 1 (full tank).

Examples

Example 1

if (fuel vehicle player == 0) then { hint "The vehicle is out of fuel!" };

See also

setFuel · setFuelCargo · getFuelCargo

Community notes

UNN

Vehicles refuelled in game with the Fuel trucks e.t.c never get completely refuelled. After refuelling, rather than returning a value of 1 when the fuel command is called. They return a value greater than 0.98 and less than 1.

fusselwurm

returns

  • 1 for units (dead or alive)
  • 0 for objNull