refactor(vehicleKey): enhance key management functions with assertions, improved documentation and remove vehicle keys where they was missing

This commit is contained in:
XenoS-ITA committed 2025-08-21 01:23:58 +02:00
1 parent 3289711297
commit 9e810d4b24
13 files changed
+271 -44

No files matched your search

+10 -9
View File
@@ -1,19 +1,20 @@
---@diagnostic disable: duplicate-set-field
VehicleKey = VehicleKey or {}
---This will give keys to the specifed vehicle/plate.
---@param vehicle number The vehicle entity ID.
---@param plate string The plate of the vehicle.
---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)
return true, Prints.Error("There Is No Vehicle Key System Installed")
Prints.Info("There is no compatible vehicle key resource.")
end
---This will remove keys from the specifed vehicle/plate.
---@param vehicle number The vehicle entity ID.
---@param plate string The plate of the vehicle.
---@return boolean | nil
---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)
return true, Prints.Error("There Is No Vehicle Key System Installed")
Prints.Info("There is no compatible vehicle key resource.")
end
return VehicleKey