lock

From Bohemia Interactive Community
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Lock vehicle (disable mounting / dismounting) for player. This command will remove user get in/get out actions but will not stop player getting into or out of vehicle via script commands (e.g moveInCargo).
Alternative syntax is similar to setVehicleLock but with numbers.
Groups:
Object Manipulation

Syntax

Syntax:
vehicleName lock locked
Parameters:
vehicleName: Object
locked: Boolean - true to lock, false to unlock
Return Value:
Nothing

Alternative Syntax

Syntax:
vehicleName lock lockstate
Parameters:
vehicleName: Object
lockstate: Number - can be one of the following:
0 - Unlocked
1 - Default (player subordinate cannot enter until his leader says so)
2 - Locked
3 - Locked for player
Return Value:
Nothing

Examples

Example 1:
_jeepOne lock true;
Example 2:
heli lock true; locked heli; // 2 heli lock false; locked heli; // 0 heli lock 1; locked heli; // 1

Additional Information

See also:
locked setVehicleLock lockDriver lockCargo lockTurret

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
Tankbuster - c
Posted on Jan 09, 2010 - 22:48 (UTC)
Lock prevents AI persons mounting or dismounting vehicles when ordered to do so and players are prevented from doing both too, but AI will still dismount when a vehicle is damaged.
cali - c
Posted on Sep 22, 2010 - 04:56 (UTC)
If an AI group (e.g Mechanized Infantry) has its vehicle locked with its crew in it, it will mount or dismount it anyway. But a player in this group won't be able to enter the vehicle.