# Server

## toggleLock

(Un)locks the closest vehicle

<mark style="color:red;">**Parameters**</mark>\
**playerId** - `number` - The ServerId of the player\
**plate** - `string?` - The Plate that should be (un)locked - **Optional**

```lua
exports.msk_vehiclekeys:toggleLock(playerId, plate)
```

## toggleLockAdmin

(Un)locks the closest vehicle without a key needed

<mark style="color:red;">**Parameters**</mark>\
**playerId** - `number` - The ServerId of the player\
**plate** - `string?` - The Plate that should be (un)locked - **Optional**

```lua
exports.msk_vehiclekeys:toggleLockAdmin(playerId, plate)
```

## GetVehicleLockState

Get whether the vehicle is locked or unlocked

<mark style="color:red;">**Parameters**</mark>\
**vehicle** - `int` - A vehicle handle

<mark style="color:green;">**Returns**</mark>\
**isLocked** - `boolean` - whether the vehicle is locked or unlocked

```lua
local isLocked = exports.msk_vehiclekeys:GetVehicleLockState(vehicle)

-- You can also use this:
local isLocked = Entity(vehicle).state.isLocked
```

## GetVehicleLockStatus

Get the current Lock Status

<mark style="color:red;">**Parameters**</mark>\
**vehicle** - `int` - A vehicle handle

<mark style="color:green;">**Returns**</mark>\
**lockStatus** - `number` - Lockstate (1 if unlocked / 2 if locked)

```lua
local lockStatus = exports.msk_vehiclekeys:GetVehicleLockStatus(vehicle)

-- You can also use this:
local lockStatus = Entity(vehicle).state.lockState
```

## IsVehicleWhitelisted

<mark style="color:red;">**Parameters**</mark>\
**plate** - `string` - Vehicle Plate\
**model** - `int` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**isWhitelisted** - `boolean` - whether the vehicle is whitelisted or not

```lua
local isWhitelisted = exports.msk_vehiclekeys:IsVehicleWhitelisted(plate, model)
```

## IsVehicleBlacklisted

<mark style="color:red;">**Parameters**</mark>\
**plate** - `string` - Vehicle Plate\
**model** - `int` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**isBlacklisted** - `boolean` - whether the vehicle is blacklisted or not

```lua
local isBlacklisted = exports.msk_vehiclekeys:IsVehicleBlacklisted(plate, model)
```

## IsAdminVehicle

<mark style="color:red;">**Parameters**</mark>\
**plate** - `string` - Vehicle Plate\
**model** - `int` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**isAdminVehicle** - `boolean` - whether the vehicle is a admin vehicle or not

```lua
local isAdminVehicle = exports.msk_vehiclekeys:IsAdminVehicle(plate, model)
```

## IsAdminVehicleAllowed

Checks if the Player with playerId has AcePermission and if the vehicle is a admin vehicle

<mark style="color:red;">**Parameters**</mark>\
**playerId** - `number` - The ServerId of the player\
**plate** - `string` - Vehicle Plate\
**model** - `int` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**isAdminAllowed** - `boolean` - whether the Player has Ace Permission and if the vehicle is a admin vehicle

```lua
local isAdminAllowed = exports.msk_vehiclekeys:IsAdminVehicle(playerId, plate, model)
```

## GetAllVehicleKeys

Gets all vehicle keys saved in vehiclekeys.json

<mark style="color:green;">**Returns**</mark>\
**vehicleKeys** - `table` - All Vehicle Keys

```lua
local vehicleKeys = exports.msk_vehiclekeys:GetAllVehicleKeys()

for identifier, keys in pairs(vehicleKeys) do
    for i = 1, #keys do
        print(identifier, keys[i].plate, keys[i].model, keys[i].type)
    end
end
```

## RefreshPlayerKeys

It will add not existing permanent keys from owned vehicles to the player

<mark style="color:red;">**Parameters**</mark>\
**playerId** - `number` - The ServerId of the player

```lua
exports.msk_vehiclekeys:RefreshPlayerKeys(playerId)
```

## GetPlayerKeys

Gets the players vehicle keys

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the keys from

<mark style="color:green;">**Returns**</mark>\
**keys** - `table` - Players Vehicle Keys

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local keys = exports.msk_vehiclekeys:GetPlayerKeys(playerData)

-- Example: 
local keys = exports.msk_vehiclekeys:GetPlayerKeys({source = playerId})

for i = 1, #keys do
    print(keys[i].plate, keys[i].model, keys[i].type)
end
```

## GetPlayerPrimaryKeys

Gets the players primary vehicle keys

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the primary keys from

<mark style="color:green;">**Returns**</mark>\
**keys** - `table` - Players Vehicle Keys

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local keys = exports.msk_vehiclekeys:GetPlayerPrimaryKeys(playerData)

-- Example: 
local keys = exports.msk_vehiclekeys:GetPlayerPrimaryKeys({source = playerId})

for i = 1, #keys do
    print(keys[i].plate, keys[i].model, keys[i].type)
end
```

## GetPlayerSecondaryKeys

Gets the players secondary vehicle keys

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the secondary keys from

<mark style="color:green;">**Returns**</mark>\
**keys** - `table` - Players Vehicle Keys

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local keys = exports.msk_vehiclekeys:GetPlayerSecondaryKeys(playerData)

-- Example: 
local keys = exports.msk_vehiclekeys:GetPlayerSecondaryKeys({source = playerId})

for i = 1, #keys do
    print(keys[i].plate, keys[i].model, keys[i].type)
end
```

## GetPlayerTempKeys

Gets the players temporary vehicle keys

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the temporary keys from

<mark style="color:green;">**Returns**</mark>\
**keys** - `table` - Players Vehicle Keys

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local keys = exports.msk_vehiclekeys:GetPlayerTempKeys(playerData)

-- Example: 
local keys = exports.msk_vehiclekeys:GetPlayerTempKeys({source = playerId})

for i = 1, #keys do
    print(keys[i].plate, keys[i].model, keys[i].type)
end
```

## HasPlayerKey

Checks whether the player has a key for the given plate and model or not

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he has a key\
**plate** - `string` - Vehicle Plate\
**model** - `number` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**hasKey** - `boolean` - whether the player has a key for the given vehicle or not

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

```lua
local hasKey = exports.msk_vehiclekeys:HasPlayerKey(playerData, plate, model)

-- Example
local hasKey = exports.msk_vehiclekeys:HasPlayerKey({source = playerId}, plate, model)
```

## HasPlayerPrimaryKey

Checks whether the player has a primary key for the given plate and model or not

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he has a primary key\
**plate** - `string` - Vehicle Plate\
**model** - `number` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**hasKey** - `boolean` - whether the player has a primary key for the given vehicle or not

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

```lua
local hasKey = exports.msk_vehiclekeys:HasPlayerPrimaryKey(playerData, plate, model)

-- Example
local hasKey = exports.msk_vehiclekeys:HasPlayerPrimaryKey({source = playerId}, plate, model)
```

## HasPlayerSecondaryKey

Checks whether the player has a secondary key for the given plate and model or not

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he has a secondary key\
**plate** - `string` - Vehicle Plate\
**model** - `number` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**hasKey** - `boolean` - whether the player has a secondary key for the given vehicle or not

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

```lua
local hasKey = exports.msk_vehiclekeys:HasPlayerSecondaryKey(playerData, plate, model)

-- Example
local hasKey = exports.msk_vehiclekeys:HasPlayerSecondaryKey({source = playerId}, plate, model)
```

## HasPlayerTempKey

Checks whether the player has a temporary key for the given plate and model or not

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he has a temporary key\
**plate** - `string` - Vehicle Plate\
**model** - `number` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
**hasKey** - `boolean` - whether the player has a temporary key for the given vehicle or not

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

```lua
local hasKey = exports.msk_vehiclekeys:HasPlayerTempKey(playerData, plate, model)

-- Example
local hasKey = exports.msk_vehiclekeys:HasPlayerTempKey({source = playerId}, plate, model)
```

## GetPlayerVehicles

Get the players vehicles saved in database: owned\_vehicles

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the vehicles from

<mark style="color:green;">**Returns**</mark>\
**vehicles** - `table` - Players Vehicles

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local vehicles = exports.msk_vehiclekeys:GetPlayerVehicles(playerData)

-- Example
local vehicles = exports.msk_vehiclekeys:GetPlayerVehicles({source = playerId})

for i = 1, #vehicles do
    print(vehicles[i].plate, vehicles[i].model)
end
```

## IsVehicleOwner

Checks whether the player is the owner of the given vehicle

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he is the vehicle owner

<mark style="color:green;">**Returns**</mark>\
**isOwner** - `boolean` - whether the player is the owner of the given vehicle

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local isOwner = exports.msk_vehiclekeys:IsVehicleOwner(playerData)

-- Example
local isOwner = exports.msk_vehiclekeys:IsVehicleOwner({source = playerId})
```

## HasPlayerKeyOrIsVehicleOwner

Checks whether the player has a key or is vehicle owner

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to check if he has a key\
**plate** - `string` - Vehicle Plate\
**model** - `number` - Vehicle Model

<mark style="color:green;">**Returns**</mark>\
hasKeyOrIsOwner - `boolean` - whether the player has a key or is vehicle owner

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

```lua
local hasKeyOrIsOwner = exports.msk_vehiclekeys:HasPlayerKeyOrIsVehicleOwner(playerData, plate, model)

-- Example
local hasKeyOrIsOwner = exports.msk_vehiclekeys:HasPlayerKeyOrIsVehicleOwner({source = playerId}, plate, model)
```

## GetPlayerKeysAndVehicles

Gets the player keys and owned vehicles

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player which you want to get the keys and vehicles from

<mark style="color:green;">**Returns**</mark>\
**vehicles** - `table` - Players Vehicles\
**keys** - `table` - Players Vehicle Keys

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

```lua
local keys, vehicles = exports.msk_vehiclekeys:GetPlayerKeysAndVehicles(playerData)

-- Example
local keys, vehicles = exports.msk_vehiclekeys:GetPlayerKeysAndVehicles({source = playerId})

for i = 1, #keys do
    print(keys[i].plate, keys[i].model, keys[i].type)
end

for i = 1, #vehicles do
    print(vehicles[i].plate, vehicles[i].model)
end
```

## AddKey

Adds a key to the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to add the key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel, type = keyType}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId, type = keyType}`

```lua
exports.msk_vehiclekeys:AddKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:AddKey({source = playerId}, {plate = 'LS 1234', model = 1093792632, type = 'secondary'})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:AddKey({source = playerId}, {netId = vehicleNetId, type = 'secondary'})
```

## AddPrimaryKey

Adds a primary key to the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to add the primary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:AddPrimaryKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:AddPrimaryKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:AddPrimaryKey({source = playerId}, {netId = vehicleNetId})
```

## AddSecondaryKey

Adds a secondary key to the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to add the secondary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:AddSecondaryKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:AddSecondaryKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:AddSecondaryKey({source = playerId}, {netId = vehicleNetId})
```

## AddTempKey

Adds a temporary key to the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to add the temporary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:AddTempKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:AddTempKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:AddTempKey({source = playerId}, {netId = vehicleNetId})
```

## RemoveKey

Removes the key from the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to remove the key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel, type = keyType}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId, type = keyType}`

```lua
exports.msk_vehiclekeys:RemoveKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:RemoveKey({source = playerId}, {plate = 'LS 1234', model = 1093792632, type = 'secondary'})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:RemoveKey({source = playerId}, {netId = vehicleNetId, type = 'secondary'})
```

## RemovePrimaryKey

Removes the primary key from the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to remove the primary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:RemovePrimaryKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:RemovePrimaryKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:RemovePrimaryKey({source = playerId}, {netId = vehicleNetId})
```

## RemoveSecondaryKey

Removes the secondary key from the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to remove the secondary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:RemoveSecondaryKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:RemoveSecondaryKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:RemoveSecondaryKey({source = playerId}, {netId = vehicleNetId})
```

## RemoveTempKey

Removes the temporary key from the player

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player to whom you want to remove the temporary key\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}` - *Use this if the player is not Online*

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:RemoveTempKey(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:RemoveTempKey({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:RemoveTempKey({source = playerId}, {netId = vehicleNetId})
```

## ExchangeVehicleLocks

Exchange the vehicle locks of the given vehicle.\
All Keys that other players might have for this vehicle will be deleted.

<mark style="color:red;">**Parameters**</mark>\
**playerData** - `table` - PlayerData of the player who is the vehicle owner\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `playerData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:ExchangeVehicleLocks(playerData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:ExchangeVehicleLocks({source = playerId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:ExchangeVehicleLocks({source = playerId}, {netId = vehicleNetId})
```

## TransferVehicle

The given vehicle will be transfered to the given player

<mark style="color:red;">**Parameters**</mark>\
**ownerData** - `table` - PlayerData of the player who is the current vehicle owner\
**targetData** - `table` - PlayerData of the player who gets the vehicle\
**vehicleData** - `table` - Vehicle Data such as plate, model or netId

<mark style="color:blue;">**Description**</mark>\
For the Parameter `ownerData` or `targetData` you can set:

* `{source = playerId}`
* `{identifier = playerIdentifier}`

For the Parameter `vehicleData` you can set:

* `{plate = vehiclePlate, model = vehicleModel}` -> "model" is not required if you are sure that the plate exists in your database (owned\_vehicles/player\_vehicles)
* `{netId = vehicleNetId}`

```lua
exports.msk_vehiclekeys:TransferVehicle(ownerData, targetData, vehicleData)

-- Example 1
exports.msk_vehiclekeys:TransferVehicle({source = playerId}, {source = targetId}, {plate = 'LS 1234', model = 1093792632})

-- Example 2
local vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle)
exports.msk_vehiclekeys:TransferVehicle({source = playerId}, {source = targetId}, {netId = vehicleNetId})
```

## ChangeNumberPlate

Only changes the Platenumber for all existing keys

<mark style="color:red;">**Parameters**</mark>\
**oldPlate** - `string` - Old platenumber\
**newPlate** - `string` - New platenumber\
**changeSQL** - `boolean` - Change SQL or not - *default: false*

```lua
exports.msk_vehiclekeys:ChangeNumberPlate(oldPlate, newPlate, changeSQL)

-- With SQL changes
exports.msk_vehiclekeys:ChangeNumberPlate("ABC 123", "XYZ 789", true)

-- Without SQL changes
exports.msk_vehiclekeys:ChangeNumberPlate("ABC 123", "XYZ 789", false)
```
