diff --git a/[core]/es_extended/server/modules/inventory/events/registrations/pickup.lua b/[core]/es_extended/server/modules/inventory/events/registrations/pickup.lua index f41fb10f0..44ceca1af 100644 --- a/[core]/es_extended/server/modules/inventory/events/registrations/pickup.lua +++ b/[core]/es_extended/server/modules/inventory/events/registrations/pickup.lua @@ -6,13 +6,18 @@ if Config.CustomInventory then end RegisterNetEvent("esx:onPickup", function(pickupId) + pickupId = tonumber(pickupId) + if not pickupId then + return + end + if not Core.InventoryEvents.ConsumeRate("pickup", source) then return end local pickup = Core.Pickups[pickupId] - if not pickup then + if not pickup or pickup.claimed then return end @@ -32,10 +37,12 @@ RegisterNetEvent("esx:onPickup", function(pickupId) return end + pickup.claimed = true local success = false if pickup.type == "item_standard" then if not xPlayer.canCarryItem(pickup.name, pickup.count) then + pickup.claimed = nil return xPlayer.showNotification(TranslateCap("threw_cannot_pickup")) end @@ -46,6 +53,7 @@ RegisterNetEvent("esx:onPickup", function(pickupId) success = true elseif pickup.type == "item_weapon" then if xPlayer.hasWeapon(pickup.name) then + pickup.claimed = nil return xPlayer.showNotification(TranslateCap("threw_weapon_already")) end @@ -63,5 +71,7 @@ RegisterNetEvent("esx:onPickup", function(pickupId) local targets = Core.GetPickupTargets(pickup.coords, pickup.bucket) Core.RemovePickup(pickupId, targets) + else + pickup.claimed = nil end end) \ No newline at end of file diff --git a/[core]/esx_identity/server/main.lua b/[core]/esx_identity/server/main.lua index 5c13aad74..c23af8d15 100644 --- a/[core]/esx_identity/server/main.lua +++ b/[core]/esx_identity/server/main.lua @@ -338,7 +338,7 @@ if Config.EnableCommands then end end, false, { help = TranslateCap("show_active_character") }) - ESX.RegisterCommand("chardel", "user", function(xPlayer) + ESX.RegisterCommand("chardel", "admin", function(xPlayer) if xPlayer and xPlayer.getName() then local identifier = xPlayer.getIdentifier() if Config.UseDeferrals then