Server

This section completes the API reference by covering Inventory, Server-Side Vehicle Keys, and Third-Party Banking integrations. These functions are located in integration/server/ and exposed via the main Lib47 object.

Inventory

The lib provides a unified API for managing player inventories.

Lib47.AddItem

Adds an item to the player's inventory. Handles slot and metadata for supported inventories.

--- @param source number Player Server ID
--- @param item string Item name
--- @param amount number Count
--- @param slot number|nil (Optional) Specific slot
--- @param meta table|nil (Optional) Item metadata
--- @return boolean Success
local success = Lib47.AddItem(source, 'water', 5, nil, { quality = 100 })

Lib47.RemoveItem

Removes an item from the player's inventory.

--- @param source number Player Server ID
--- @param item string Item name
--- @param amount number Count
--- @return boolean Success
local success = Lib47.RemoveItem(source, 'water', 1)

Lib47.GetInventoryItem

Gets the count of a specific item in the player's inventory.

Lib47.HasEnoughItem

Checks if the player has at least the specified amount of an item.

Lib47.CanCarryItem

Checks if the player has enough weight/space to carry the item (Crucial for Ox/QB/QS).

Lib47.GetItems

Returns the server's master list of items (definitions).

Lib47.GetItemLabel

Returns the label of a specific item.

Lib47.CreateUseableItem

Registers a usable item callback.


Vehicle Keys (Server)

These functions allow you to give or remove vehicle keys directly from the server side.

Lib47.GiveVehicleKey

Gives keys for a specific vehicle to a player.

Lib47.RemoveVehicleKey

Removes keys for a specific vehicle from a player.


Banking Integration

it is important to note that the Integration layer (integration/server/banking.lua) extends these functions to support third-party banking resources automatically.

Lib47.GetSocietyMoney

Retrieves the current available balance of a specific job or society account.

Lib47.AddSocietyMoney

Deposits funds into a specific job or society account.

Lib47.RemoveSocietyMoney

Withdraws or removes funds from a specific job or society account.

Last updated