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.


Chat Commands

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

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

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