✏️ fix es_extended lint errors

This commit is contained in:
Gellipapa
2024-06-16 14:26:06 +02:00
parent 0f0d48587b
commit ba6744e580
3 changed files with 7 additions and 4 deletions
+2
View File
@@ -1,5 +1,7 @@
ESX = exports["es_extended"]:getSharedObject()
OnPlayerData = function (key, val, last) end
if not IsDuplicityVersion() then -- Only register this event for the client
AddEventHandler("esx:setPlayerData", function(key, val, last)
if GetInvokingResource() == "es_extended" then
+1
View File
@@ -25,4 +25,5 @@ function TranslateCap(str, ...) -- Translate string first char uppercase
end
_ = Translate
-- luacheck: ignore _U
_U = TranslateCap
+4 -4
View File
@@ -509,20 +509,20 @@ if not Config.OxInventory then
if xPlayer.hasWeapon(itemName) then
local _, weapon = xPlayer.getWeapon(itemName)
local _, weaponObject = ESX.GetWeapon(itemName)
local pickupLabel = ""
local weaponPickupLabel = ""
local components = ESX.Table.Clone(weapon.components)
xPlayer.removeWeapon(itemName)
if weaponObject.ammo and weapon.ammo > 0 then
local ammoLabel = weaponObject.ammo.label
pickupLabel = ("%s [%s %s]"):format(weapon.label, weapon.ammo, ammoLabel)
weaponPickupLabel = ("%s [%s %s]"):format(weapon.label, weapon.ammo, ammoLabel)
xPlayer.showNotification(TranslateCap("threw_weapon_ammo", weapon.label, weapon.ammo, ammoLabel))
else
pickupLabel = ("%s"):format(weapon.label)
weaponPickupLabel = ("%s"):format(weapon.label)
xPlayer.showNotification(TranslateCap("threw_weapon", weapon.label))
end
ESX.CreatePickup("item_weapon", itemName, weapon.ammo, pickupLabel, playerId, components, weapon.tintIndex)
ESX.CreatePickup("item_weapon", itemName, weapon.ammo, weaponPickupLabel, playerId, components, weapon.tintIndex)
end
end
end)