RemoveItem

Removes an item from the player inventory.

frameworkName:CanCarryItem(source, item, count)
  • source: number
  • item: string
  • count: number

example:

function ESX:RemoveItem(source, item, amount)
    local xPlayer = ESX.Shared.GetPlayerFromId(source)
 
    xPlayer.removeInventoryItem(item, amount)
end

FetchItemCount

Returns the count of a specific item.

frameworkName:FetchItemCount(source, item)
  • source: number
  • item: string

example:

function ESX:FetchItemCount(source, item)
    local xPlayer = ESX.Shared.GetPlayerFromId(source)
 
    return xPlayer.getInventoryItem(item).count
end

GiveMoney

Gives money to the player.

frameworkName:GiveMoney(source, amount)
  • source: number
  • amount: number

example:

function ESX:GiveMoney(source, amount)
    local xPlayer = ESX.Shared.GetPlayerFromId(source)
 
    xPlayer.addMoney(amount)
end