Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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)
2 changes: 1 addition & 1 deletion [core]/esx_identity/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading