fuel: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(74 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|F]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97|F]]
[[Category:Scripting Commands OFP 1.46|F]]
[[Category:Scripting Commands ArmA|F]]


back to [[Scripting_Reference#F|COMREF]]
|game1= ofp
|version1= 1.00


<h2 style="color:#000066">'''fuel ''vehicle'''''</h2>
|game2= ofpe
|version2= 1.00


|game3= arma1
|version3= 1.00


'''Operand types:'''
|game4= arma2
|version4= 1.00


'''vehicle:''' [[Object]]
|game5= arma2oa
|version5= 1.50


'''Type of returned value:'''
|game6= tkoh
|version6= 1.00


[[Number]]
|game7= arma3
|version7= 0.50


'''Description:'''
|arg= global


Check how much '''fuel''' the '''vehicle''' has left in the gas tank, in range 0 to 1.
|gr1= Object Manipulation


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


'''Example:'''
|s1= [[fuel]] vehicle


? ('''fuel''' ([[vehicle]] [[player]]) <25) : [[hint]] "Fuel is running low"
|p1= vehicle: [[Object]]
 
|r1= [[Number]] - the returned number is in range 0 (empty tank) to 1 (full tank).
 
|x1= <sqf>if (fuel vehicle player == 0) then { hint "The vehicle is out of fuel!" };</sqf>
 
|seealso= [[setFuel]] [[setFuelCargo]] [[getFuelCargo]]
}}
 
{{Note
|user= UNN
|timestamp= 20060813123600
|text= 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.
}}
 
{{Note
|user= fusselwurm
|timestamp= 20201219191000
|text= returns
* ''1'' for units (dead or alive)
* ''0'' for ''objNull''
}}

Latest revision as of 12:44, 12 March 2024

Hover & click on the images for description

Description

Description:
Checks how much fuel is left in the gas tank of a vehicle.
Groups:
Object Manipulation

Syntax

Syntax:
fuel vehicle
Parameters:
vehicle: Object
Return Value:
Number - the returned number is in range 0 (empty tank) to 1 (full tank).

Examples

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

Additional Information

See also:
setFuel setFuelCargo getFuelCargo

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
UNN - c
Posted on Aug 13, 2006 - 12:36 (UTC)
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 - c
Posted on Dec 19, 2020 - 19:10 (UTC)
returns
  • 1 for units (dead or alive)
  • 0 for objNull