Files
community_bridge/modules/vehicleKey/t1ger_keys/client/client.lua
T

31 lines
1.0 KiB
Lua
Raw Normal View History

---@diagnostic disable: duplicate-set-field
local resourceName = "t1ger_keys"
2025-05-18 23:45:37 -04:00
if GetResourceState(resourceName) == 'missing' then return end
2025-02-24 18:23:19 -05:00
2025-02-06 05:33:26 -05:00
VehicleKey = VehicleKey or {}
---Gives the player (self) the keys of the specified vehicle.
---@param vehicle number The vehicle entity handle.
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.GiveKeys = function(vehicle, plate)
assert(vehicle, "vehicle is nil")
assert(DoesEntityExist(vehicle), "vehicle does not exist")
if not plate then
plate = GetVehicleNumberPlateText(vehicle)
end
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
return exports['t1ger_keys']:GiveTemporaryKeys(plate, model, '')
end
---Removes the keys of the specified vehicle from the player (self).
---@param vehicle number The vehicle entity handle.
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.RemoveKeys = function(vehicle, plate)
Prints.Info("t1ger_keys doesnt support removing keys.")
end
return VehicleKey