Make an item throwable#
An item can be thrown and placed when its entry in ox_inventory/data/items.lua has a dropProp, or when Config.itemThrowing.fallbackProp is set. Weapons are never thrown.
['burger'] = {
label = 'Burger',
dropProp = 'prop_cs_burger_01',
},
Use a table to set how it sits in the hand while aiming:
dropProp = {
model = 'prop_cs_burger_01',
hand = { bone = 28422, pos = vec3(0.0, 0.0, 0.0), rot = vec3(0.0, 0.0, 0.0) },
},
Limit clothing items on a server where they have value#
Config.clothingMint.requireAppearanceSave = true
Config.clothingMint.blockedDrawables = {
-- per clothing key, add the drawables that must never become items
}
The server checks the drawable against the ped it sees, and under OneSync the player's client owns that ped. A modded client could dress its ped in any drawable and have it made into an item, once per piece per cooldown. Requiring an appearance save narrows when an item can be made.
Add a backpack#
Add the item to ox_inventory/data/items.lua with the glitch-inventoryAddons.useClothing server export, then add an entry under extraWeightAndSlotItems:
['mybag'] = {
weight = 120,
slots = 6,
skin = {
male = { ['bags_1'] = 45, ['bags_2'] = 0 },
female = { ['bags_1'] = 45, ['bags_2'] = 0 },
},
},
Keep slots within countOfBlockedSlots.
Borrow throw mode from another resource#
-- server
local ok = exports['glitch-inventoryAddons']:setBorrowedThrowing(source, true)
if not ok then
-- the player used up their borrow budget for this window
end
exports['glitch-inventoryAddons']:setBorrowedThrowing(source, false)
Borrowing only turns the snowball hiding on, and never sets the itemThrowing flag.
Take clothing off from another script#
-- client: toggle the first worn piece of these keys, or put one on from the pockets
TriggerServerEvent('glitch-inventoryAddons:toggleWorn', { 'mask' })
Check backpack slots from a script#
local top = exports['glitch-inventoryAddons']:getAvailableSlots(source) -- server
local mine = exports['glitch-inventoryAddons']:getAvailableSlots() -- client