Keys/Chat/Events/Exports

INFORMATION

Key Binds

  • You can modify or disable these keys in the Keys and Commands section of the [configs/config.lua].

  • Ensure you understand how Key Mapping works.

Key

Description

E

Open the outside quick garage.

H

Enter the inside garage.

G

Store your vehicle.

E

Hotwire a vehicle.

M

Toggle vehicle lock.


Chat Commands

  • You can rename or disable these chat commands in the Keys and Commands section of the [configs/config.lua].

Command

Description

/impound

Impound system to impound a vehicle.

/transfervehicle

Transfer system to transfer a vehicle to another player.

/checkmiles

Check the mileage of the vehicle you are in.

/garagespace

Players with defined jobs can sell garage slots to other players.

/garagespacecheck

Check how many garage spaces you have.

/vehicle-add

(Staff only) Add the vehicle you are currently sat inside to a player's garage.

/vehicle-delete

(Staff only) Delete the vehicle you are currently sat inside from the database.

/vehicle-plate

(Staff only) Change the plate of the vehicle you are currently sat inside.

/vehicle-keys

(Staff only) Give yourself keys to the vehicle you are currently sat inside.

/privategarage

Players with defined jobs can create and sell private garages to players.

/removefakeplate

Remove a fake plate from the closest vehicle.

/givekey

Give temporary keys (keys delete after server restart) to to the closest player to the closest vehicle.

/givekeysave

Give saved keys (keys save in database) to to the closest player to the closest vehicle.

/removekey

Open the keys UI to remove keys you have given out to other players.

/vehlock

Toggle vehicle lock.

/lockpick

Start lockpicking the closest vehicle.

Events

  • These events are entirely optional and can be used as needed.

Mileage

Check a vehicle's mileage.
TriggerEvent('cd_garage:checkmileage')

Impound Vehicle

Opens the impound UI. You can send a vehicles id as the first argument, otherwise, it will choose the closest vehicle.
TriggerEvent('cd_garage:ImpoundVehicle')

Transfer Vehicle

Transfer the vehicle you are sat in. You must send the player's server-id in the first argument.
TriggerEvent('cd_garage:TransferVehicle', playerid)

Vehicle Lock

Toggle vehicle lock of the closest vehicle.
TriggerEvent('cd_garage:ToggleVehicleLock')

Update Garage Type

Update the database with the correct garage_type for the vehicle a player is sat in.
TriggerEvent('cd_garage:UpdateGarageType')

Impound Vehicle Directly Through code

This event allows you to send vehicle's to the impound directly through code, without needing the in-game UI.
TriggerEvent('cd_garage:ImpoundVehicle:Direct', {
    plate = plate, -- string, the vehicle's plate.
    impound = impound, -- number, the ImpoundID from the Config.ImpoundLocations.
    props = props, -- table, the vehicles props.
    time = time, -- number, the time the vehicle was impounded.
    description = description, -- string, the description of why the vehicle was impounded.
    canretrive = canretrive, -- boolean, if the vehicle can be retrieved from the impound by the owner.
    vehicle = vehicle, -- number, the vehicle entity.
})

Exports

These exports are entirely optional and can be used as needed.

Get Garage Type

Returns the type of vehicle the player is sat in (‘car’ / ‘boat’ / ‘air’) (string).
exports['cd_garage']:GetGarageType(vehicle)

Get Mileage Data

Returns the mileage table which includes; plate, mileage, maxhealth (table).
exports['cd_garage']:GetAdvStats(plate)

Get Keys Data

Returns a players full key table which includes; all vehicles they have keys to (table).
exports['cd_garage']:GetKeysData()

Does Player Have Keys

Returns if the player has keys to the defined vehicle (boolean).
exports['cd_garage']:DoesPlayerHaveKeys(plate)

Get Plate

Returns the vehicle plate from the vehicle the player is sat in (string).
exports['cd_garage']:GetPlate(vehicle)

Get Config

Returns the full garage config (table).
exports['cd_garage']:GetConfig()

Get Vehicles Data

Returns a large table from the cached vehicles data of all vehicles which includes; name, hash, price, category, model (table).
exports['cd_garage']:GetVehiclesData()

Usable Items

  • Usable items can be renamed or disabled in [configs/config.lua].

Item NameDescription

lockpick

Start lockpicking the closest vehicle.

Run these SQL queries in your database.
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('lockpick', 'Lockpick', 1, 0, 1);

Last updated

Logo

Codesign Software © All rights reserved