Module sv_items

Item functions

Functions

AddItem (src, name, amount, data) AddItem function.
RemoveItem (src, name, amount) RemoveItem function.
HasItem (src, name, amount) HasItem function.
HasItems (src, items) HasItems function.
ItemHasData (src, name, data) ItemHasData function.
GetItemLabel (name) GetItemLabel function.
ConvertRecipeIntoString (recipe) ConvertRecipeIntoString function.
GetItemAmount (src, name, data) GetItemAmunt function.


Functions

AddItem (src, name, amount, data)
AddItem function. This function adds an item to a player.

Parameters:

  • src The player to add the item to. number
  • name The item name. string
  • amount The item amount. number
  • data The item data. table

Usage:

    exports.jones_util:AddItem(src, "weed", 1, {quality = 100})
RemoveItem (src, name, amount)
RemoveItem function. This function removes an item from a player.

Parameters:

  • src The player to remove the item from. number
  • name The item name. string
  • amount The item amount. number

Usage:

    exports.jones_util:RemoveItem(src, "weed", 1)
HasItem (src, name, amount)
HasItem function. This function checks if a player has an item.

Parameters:

  • src The player to check the item from. number
  • name The item name. string
  • amount The item amount. number

Returns:

    boolean

Usage:

    local hasItem = exports.jones_util:HasItem(src, "weed", 1)
HasItems (src, items)
HasItems function. This function checks if a player has items.

Parameters:

  • src The player to check the items from. number
  • items The items to check. table

Returns:

    boolean

Usage:

    local hasItems = exports.jones_util:HasItems(src, {
    	["weed"] = 1,
    	["weed_brick"] = 1
    })
ItemHasData (src, name, data)
ItemHasData function. This function checks if an item has data.

Parameters:

  • src The player to check the item from. number
  • name The item name. string
  • data The item data. table

Returns:

    boolean

Usage:

    local hasData = exports.jones_util:ItemHasData("weed", {quality = 100})
GetItemLabel (name)
GetItemLabel function. This function returns the item label.

Parameters:

  • name The item name. string

Returns:

    string

Usage:

    local label = exports.jones_util:GetItemLabel("weed")
ConvertRecipeIntoString (recipe)
ConvertRecipeIntoString function. This function converts a recipe into a string.

Parameters:

  • recipe The recipe to convert. table

Returns:

    string

Usage:

    local recipeString = exports.jones_util:ConvertRecipeIntoString({
    	["weed"] = 1,
    	["weed_brick"] = 1
    })
GetItemAmount (src, name, data)
GetItemAmunt function. This function returns the item amount.

Parameters:

  • src The player to check the item from. number
  • name The item name. string
  • data The item data. table

Returns:

    number

Usage:

    local amount = exports.jones_util:GetItemAmount(src, "weed", {quality = 100})
generated by LDoc 1.5.0 Last updated 2024-05-13 19:05:24