refactor(vehicleKey): add client.lua for mVehicle
This commit is contained in:
1 parent
783c15ad9c
commit
a289e6f1d2
1 file changed
+26
@@ -0,0 +1,26 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local resourceName = "mVehicle"
|
||||
if GetResourceState(resourceName) == 'missing' then return end
|
||||
|
||||
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")
|
||||
|
||||
exports.mVehicle:AddTemporalVehicleClient(vehicle)
|
||||
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("mVehicle doesnt support removing keys.")
|
||||
end
|
||||
|
||||
return VehicleKey
|
||||
Reference in new issue
Block a user