Arma 3 Scripting

lock

  • Local argument
  • Global effect
  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00

Command · Markdown · JSON · original wiki page

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).

Note

Alternative syntax is similar to setVehicleLock but with numbers.

Syntax

Syntax 1

vehicleName lock locked

Parameters:

Returns: Nothing

Syntax 2

since arma3 0.50

vehicleName lock lockstate

Parameters:

Returns: 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

See also

locked · setVehicleLock · lockDriver · lockCargo · lockTurret

Community notes

Tankbuster

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

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.