Item

Server functions that are in some way related to the item aspects.

Wosa.Character.Inventory.Item.RemoveAllCustom(
    user --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.

Description:
Removes all the custom items from the current selected character. Items such as
pocket cash, vanilla card etc will remain but "dropable" items will be deleted.
Used for when respawning for example when respawning.

]]
Wosa.Character.Inventory.Item.Add(
    user --[[ int ]],
    inventoryTable --[[ string ]],
    data --[[ table ]])
)

--[[

// Core Dev Notice: Should prolly remove "inventoryTable" and auto set it for less confusion.

Parameters:
-> user: The PlayerID of the user.
-> inventoryTable: The inventory table.
-> user: The PlayerID of the user.

Description:
Add a item to a users character.

Example:
data = {itemName = 'RI_EXAMPLE_ITEM', displayName = 'Example Item', Usable = true, Givable = true, Dropable = true, String1 = '', String2 = '', String3 = '', Bool1 = false, Bool2 = false, Bool3 = false, Int1 = 0, Int2 = 0, Int3 = 0, Float1 = 0.0, Float2 = 0.0, Float3 = 0.0 }
Wosa.Character.Inventory.Item.Add(user, inventoryTable, data)

]]
Wosa.Character.Inventory.Item.Remove(
    user --[[ int ]],
    itemName --[[ string ]],
    itemID --[[ int ]]
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> itemName: The item name of the item you want to remove.
-> itemID: The databaseID of the item you want to remove.

Description:
So, This can be used in a few ways. If you leave "itemID" nil then you will remove
all items named the "itemName" in the inventory. If you want to remove a specific
item input the "itemID".

Example:
data = {itemName = 'RI_EXAMPLE_ITEM', displayName = 'Example Item', Usable = true, Givable = true, Dropable = true, String1 = '', String2 = '', String3 = '', Bool1 = false, Bool2 = false, Bool3 = false, Int1 = 0, Int2 = 0, Int3 = 0, Float1 = 0.0, Float2 = 0.0, Float3 = 0.0 }
Wosa.Character.Inventory.Item.Add(user, inventoryTable, data)

]]
local DoesItemExist = Wosa.Character.Inventory.Item.Exist(
    user, --[[ int ]],
    itemName --[[ string ]],
)

--[[

Parameters:
-> user: The PlayerID of the user.
-> itemName: The item name of the item you want to see if it exists.

Returnal:
-> DoesItemExist : bool

Description:
See if the item of choice exists in the players inventory.

]]

Last updated

Was this helpful?