Add GetResourceName function to all modules

Introduces a standardized GetResourceName function to banking, clothing, dispatch, doorlock, framework, fuel, helptext, housing, and other modules. This function returns the name of the in-use resource, improving resource identification and interoperability across the codebase.
This commit is contained in:
MrNewb committed 2025-09-10 12:27:12 -04:00
1 parent cd16291038
commit 90c65dc55e
142 files changed
+784 -25

No files matched your search

@@ -11,11 +11,8 @@ VehicleKey = VehicleKey or {}
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
if not plate then plate = GetVehicleNumberPlateText(vehicle) end
TriggerServerEvent('F_RealCarKeysSystem:generateVehicleKeys', plate)
end
@@ -28,12 +25,14 @@ end
VehicleKey.RemoveKeys = function(vehicle, plate)
assert(vehicle, "vehicle is nil")
assert(DoesEntityExist(vehicle), "vehicle does not exist")
if not plate then
plate = GetVehicleNumberPlateText(vehicle)
end
if not plate then plate = GetVehicleNumberPlateText(vehicle) end
TriggerServerEvent('F_RealCarKeysSystem:removeVehicleKeysByPlate', plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
return exports.MrNewbVehicleKeys:RemoveKeysByPlate(plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
return exports['Renewed-Vehiclekeys']:removeKey(plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -6,7 +6,7 @@ VehicleKey = VehicleKey or {}
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.GiveKeys = function(vehicle, plate)
Prints.Info("There is no compatible vehicle key resource.")
print("There is no compatible vehicle key resource.")
end
---Removes the keys of the specified vehicle from the player (self).
@@ -14,7 +14,11 @@ end
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.RemoveKeys = function(vehicle, plate)
Prints.Info("There is no compatible vehicle key resource.")
print("There is no compatible vehicle key resource.")
end
VehicleKey.GetResourceName = function()
return "default"
end
return VehicleKey
@@ -11,7 +11,7 @@ VehicleKey = VehicleKey or {}
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
@@ -24,7 +24,11 @@ end
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.RemoveKeys = function(vehicle, plate)
Prints.Info("cd_garage doesnt support removing keys.")
print("cd_garage doesnt support removing keys.")
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
+4
View File
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
TriggerServerEvent("vehicles_keys:selfRemoveKeys", plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -20,7 +20,11 @@ end
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.RemoveKeys = function(vehicle, plate)
Prints.Info("mVehicle doesnt support removing keys.")
print("mVehicle doesnt support removing keys.")
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -26,4 +26,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
exports["mk_vehiclekeys"]:RemoveKey(vehicle)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -35,4 +35,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
TriggerServerEvent("okokGarage:RemoveKeys", plate, source)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
TriggerEvent("qb-vehiclekeys:client:RemoveKeys", plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
TriggerEvent("qb-vehiclekeys:client:RemoveKeys", plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -36,4 +36,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
return exports['qs-vehiclekeys']:RemoveKeys(plate, model)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -25,7 +25,11 @@ end
---@param plate? string The plate of the vehicle.
---@return nil
VehicleKey.RemoveKeys = function(vehicle, plate)
Prints.Info("t1ger_keys doesnt support removing keys.")
print("t1ger_keys doesnt support removing keys.")
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey
@@ -34,4 +34,8 @@ VehicleKey.RemoveKeys = function(vehicle, plate)
exports.wasabi_carlock:RemoveKey(plate)
end
VehicleKey.GetResourceName = function()
return resourceName
end
return VehicleKey