vehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (arma3 category)
(sqf example; note about current arma 3 output)
Line 17: Line 17:
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>? vehicle [[player]] <nowiki>!=</nowiki> [[player]] : [[hint]] "Player is in a vehicle"</code> - This example is for use in scripts. |= Example 1
|x1= SQS <code>? '''vehicle''' [[player]] <nowiki>!=</nowiki> [[player]] : [[hint]] "Player is in a vehicle"</code> |= Example 1
|x2= SQF (see Notes)<code>if ( '''vehicle''' [[player]] <nowiki>!=</nowiki> player ) then { [[hint]] "Player is in a vehicle"; };</code> |= Example 2
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 27: Line 28:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on February 16, 2014
<dt class="note">'''[[User:Strangepete|Strangepete]]'''
<dd class="note">As of Arma 3, ( vehicle unit == unit ) is TRUE for units in the vehicle's Driver seat, IF vehicle not named manually in Editor.
Example 2 will return TRUE if vehicle pre-named in Editor; Example 2 will return FALSE if vehicle not pre-named, and player in Driver seat
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 15:55, 16 February 2014

Hover & click on the images for description

Description

Description:
Vehicle in which given unit is mounted. If none, unit is returned.
Groups:
Uncategorised

Syntax

Syntax:
Object = vehicle unitName
Parameters:
unitName: Object
Return Value:
Object

Examples

Example 1:
SQS ? vehicle player != player : hint "Player is in a vehicle"
Example 2:
SQF (see Notes)if ( vehicle player != player ) then { hint "Player is in a vehicle"; };

Additional Information

See also:
See also needed

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

Notes

Posted on February 16, 2014
Strangepete
As of Arma 3, ( vehicle unit == unit ) is TRUE for units in the vehicle's Driver seat, IF vehicle not named manually in Editor. Example 2 will return TRUE if vehicle pre-named in Editor; Example 2 will return FALSE if vehicle not pre-named, and player in Driver seat

Bottom Section