---
name: "setVehicleLock"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setVehicleLock
revid: 379389
updated: 2026-10-31T00:00:00Z
---

# setVehicleLock

*Command · Object Manipulation · Arma 3 v0.50 · introduced in Operation Flashpoint: Elite v1.00*

Locality: arguments **local** · effect **global**

## Description

Sets vehicle lock. Possible values:

- "UNLOCKED"
- "DEFAULT"
- "LOCKED"
- "LOCKEDPLAYER"

## Syntax

```sqf
vehicleName setVehicleLock lockState
```

**Parameters:**

- `vehicleName`: [Object](../topics/Object.md)
- `lockState`: [String](../topics/String.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
_veh1 setVehicleLock "LOCKED";
```

## See also

[lock](../commands/lock.md) · [locked](../commands/locked.md) · [lockDriver](../commands/lockDriver.md) · [lockCargo](../commands/lockCargo.md) · [lockTurret](../commands/lockTurret.md)

## Community notes

**AgentRev** — 2014-10-22

In Arma 3:\
setVehicleLock "UNLOCKED" = same as "[lock](../commands/lock.md) 0"\
setVehicleLock "DEFAULT" = same as "[lock](../commands/lock.md) 1"\
setVehicleLock "LOCKED" = same as "[lock](../commands/lock.md) 2"\
setVehicleLock "LOCKEDPLAYER" = same as "[lock](../commands/lock.md) 3"

---

**Killzone_Kid** — 2015-03-04

DEFAULT lock is default vehicle lock when vehicle placed in editor. If player is in a group of AIs and not the leader, he will not be able to enter this vehicle as he will not have GetIn action for this vehicle.

<sub>Source: [BI Community Wiki — setVehicleLock](https://community.bistudio.com/wiki/setVehicleLock) (revision 379389).</sub>
