Skip to main content

CanPlayerCarry

note

ONLY serverside

Parameters

ParameterDescription
xPlayerESX Player from ESX.GetPlayerFromId(source)
itemObject with type & name
countItem count as a number

Example

RegisterCommand('CanPlayerCarry', function(source, args, raw)
local src = source
local xPlayer = ESX.GetPlayerFromId(src)

local canCarryItem = exports.inventory:CanPlayerCarry(xPlayer, {type = 'item_standard', name = 'apple'}, 10)
local canCarryWeapon = exports.inventory:CanPlayerCarry(xPlayer, {type = 'item_weapon', name = 'WEAPON_PISTOL'})

print(canCarryItem)
print(canCarryWeapon)
end)