Difference between revisions of "fuel"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
 
(28 intermediate revisions by 10 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#F|COMREF]]
+
{{Command|Comments=
 +
____________________________________________________________________________________________
  
<h2 style="color:#000066">'''fuel ''vehicle'''''</h2>
+
| ofp |Game name=
  
 +
|1.00|Game version=
  
'''Operand types:'''
+
|arg= global |Multiplayer Arguments=
 +
____________________________________________________________________________________________
  
'''vehicle:''' [[Object]]
+
| Checks how much fuel is left in the gas tank of a vehicle. |DESCRIPTION=
 +
____________________________________________________________________________________________
  
'''Type of returned value:'''
+
| '''fuel''' vehicle |SYNTAX=
  
[[Number]]
+
|p1= vehicle: [[Object]] |PARAMETER1=
  
'''Description:'''
+
| [[Number]] - 
 +
The returned number is in range 0 (empty tank) to 1 (full tank). |RETURNVALUE=
 +
____________________________________________________________________________________________
 +
 
 +
|x1= <code>[[if]] ([[fuel]] [[vehicle]] [[player]] == 0) [[then]] {[[hint]] "The vehicle is out of fuel!"};</code> |EXAMPLE1=
 +
____________________________________________________________________________________________
  
Check how much '''fuel''' the '''vehicle''' has left in the gas tank, in range 0 to 1.
+
| [[setFuel]], [[setFuelCargo]], [[getFuelCargo]] |SEEALSO=
  
 +
}}
  
'''Example:'''
+
<h3 style="display:none">Notes</h3>
 +
<dl class="command_description">
 +
<!-- Note Section BEGIN -->
  
? ('''fuel''' ([[vehicle]] [[player]]) <25) : [[hint]] "Fuel is running low"
+
<dt class="note">'''[[User:UNN|UNN]]'''<dd class="note">
 +
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 Section END -->
 +
</dl>
 +
 
 +
<h3 style="display:none">Bottom Section</h3>
 +
[[Category:Scripting Commands|FUEL]]
 +
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.96|FUEL]]
 +
[[Category:Scripting Commands OFP 1.46|FUEL]]
 +
[[Category:Scripting Commands ArmA|FUEL]]
 +
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Command_Group:_Vehicle_Assignment|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 22:46, 31 August 2019

Introduced with Operation Flashpoint version 1.00
  Arguments of this scripting command don't have to be local to the client the command is executed on

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

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

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

Multiplayer:
-
See also:
setFuelsetFuelCargogetFuelCargo

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

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.

Bottom Section