Client
Exports - Clientside
toggleLock
(Un)locks the closest vehicle
Parameters
vehicleData - table
- Vehicle Data such as plate, model or netId
Description
For the Parameter vehicleData
you can set:
{plate = vehiclePlate, model = vehicleModel}
{vehicle = vehicle}
GetVehicleLockState
Get whether the vehicle is locked or unlocked
Parameters
vehicle - int
- A vehicle handle
Returns
isLocked - boolean
- whether the vehicle is locked or unlocked
GetVehicleLockStatus
Get the current Lock Status
Parameters
vehicle - int
- A vehicle handle
Returns
lockStatus - number
- Lockstate (1 if unlocked / 2 if locked)
openLocksmithMenu
Opens the Locksmith Menu where you can Exchange the vehicle locks. All Keys that other players might have for this vehicle will be deleted.
openKeysMenu
Open the Keys Menu where you can see all keys that you have.
RefreshPlayerKeys
It will add not existing permanent keys from owned vehicles to the player
GetAllVehicleKeys
Gets all vehicle keys saved in vehiclekeys.json
Returns
vehicleKeys - table
- All Vehicle Keys
GetPlayerKeys
Gets the players vehicle keys
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
keys - table
- Players Vehicle Keys
GetPlayerPrimaryKeys
Gets the players primary vehicle keys
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
keys - table
- Players Vehicle Keys
GetPlayerSecondaryKeys
Gets the players secondary vehicle keys
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
keys - table
- Players Vehicle Keys
GetPlayerTempKeys
Gets the players temporary vehicle keys
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
keys - table
- Players Vehicle Keys
HasPlayerKey
Checks whether the player has a key for the given vehicle or not
Parameters
vehicle - int
- A vehicle handle
Returns
hasKey - boolean
- whether the player has a key for the given vehicle or not
HasPlayerPrimaryKey
Checks whether the player has a primary key for the given vehicle or not
Parameters
vehicle - int
- A vehicle handle
Returns
hasKey - boolean
- whether the player has a primary key for the given vehicle or not
HasPlayerSecondaryKey
Checks whether the player has a secondary key for the given vehicle or not
Parameters
vehicle - int
- A vehicle handle
Returns
hasKey - boolean
- whether the player has a secondary key for the given vehicle or not
HasPlayerTempKey
Checks whether the player has a temporary key for the given vehicle or not
Parameters
vehicle - int
- A vehicle handle
Returns
hasKey - boolean
- whether the player has a temporary key for the given vehicle or not
GetPlayerVehicles
Get the players vehicles saved in database: owned_vehicles
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
vehicles - table
- Players Vehicles
IsVehicleOwner
Checks whether the player is the owner of the given vehicle
Parameters
vehicle - int
- A vehicle handle
Returns
isOwner - boolean
- whether the player is the owner of the given vehicle
HasPlayerKeyOrIsVehicleOwner
Checks whether the player has a key or is vehicle owner
Parameters
vehicle - int
- A vehicle handle
Returns
hasKeyOrIsOwner - boolean
- whether the player has a key or is vehicle owner
GetPlayerKeysAndVehicles
Gets the player keys and owned vehicles
Parameters
playerId - number
- ServerId of the player which you want to get the keys from - Optional
Returns
vehicles - table
- Players Vehicles
keys - table
- Players Vehicle Keys
AddKey
Adds a key to the player
Parameters
vehicle - int
- A vehicle handle
type - string
- Key Type ['primary', 'secondary', 'temporary']
playerId - number
- ServerId of the player that should get the key - Optional
AddPrimaryKey
Adds a primary key to the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
AddSecondaryKey
Adds a secondary key to the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
AddTempKey
Adds a temporary key to the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
RemoveKey
Removes the key from the player
Parameters
vehicle - int
- A vehicle handle
type - string
- Key Type ['primary', 'secondary', 'temporary']
playerId - number
- ServerId of the player from that the key will be removed - Optional
RemovePrimaryKey
Removes the primary key from the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
RemoveSecondaryKey
Removes the secondary key from the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
RemoveTempKey
Removes the temporary key from the player
Parameters
vehicle - int
- A vehicle handle
playerId - number
- ServerId of the player that should get the key - Optional
ExchangeVehicleLocks
Exchange the vehicle locks of the given vehicle. All Keys that other players might have for this vehicle will be deleted.
Parameters
vehicle - int or table
- A vehicle handle or vehicle data
TransferVehicle
The given vehicle will be transfered to the given player
Parameters
targetId - number
- ServerId of the player that should get the vehicle
vehicle - int or table
- A vehicle handle or vehicle data
showDialog - boolean
- Show Input Dialog or not
Description
If the Parameter showDialog
is set to true
, then the Owner of the Vehicle get a input field where he can insert a price for the vehicle that the target player has to pay to get the vehicle.
Last updated