MenanAk47
  • Welcome
  • FAQ
  • ESX
    • ak47_whitewidowv2
      • Installation
      • Configuration
    • ak47_cannabiscafev2
      • Installation
      • Configuration
    • ak47_clothing
      • Installation
      • Configuration
      • Integration
      • Exports
      • Triggers
      • Commands
      • Common Issues
    • ak47_iclothingv3
      • Installation
    • ak47_switch
      • Installation
      • Commands
    • ak47_crutch
      • Installation
      • Triggers
      • Commands
    • ak47_housing
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_cardealer
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_ambulancejob
      • Installation
      • Guideline
      • Items
      • Integration
      • Commands
      • Triggers
      • Exports
    • ak47_gangs
      • Installation
      • Integration
      • Commands
      • Exports
    • ak47_garage
      • Installation
      • Integration
      • Commands
    • ak47_jobgarage
      • Installation
      • Integration
      • Commands
    • ak47_vehiclekeys
      • Installation
      • Integration
      • Commands
    • ak47_carboosting
      • Installation
      • Integration
      • Commands
    • ak47_safezone
      • Installation
      • Integration
      • Commands
    • ak47_inventory
      • Installation
      • Exports
        • Client
        • Server
      • Event Handlers
        • Client
        • Server
      • Commands
      • Guides
        • Custom Stash
        • External Shop
        • Protected Item
        • Convert Items
        • Show Info Value
      • Templates
        • Item
        • Weapon
        • Crafting
        • Stash
        • Shop
        • Vending
        • Dumpster
        • Tooltip
      • Modified Scripts
        • LegacyFuel
    • ak47_idcardv2
      • Installation
      • Integration
      • Commands
    • ak47_territories
      • Installation
      • Integration
      • Commands
      • Exports
  • QBCore
    • ak47_qb_whitewidowv2
      • Installation
      • Configuration
    • ak47_qb_cannabiscafev2
      • Installation
      • Configuration
    • ak47_qb_clothing
      • Installation
      • Configuration
      • Integration
      • Exports
      • Triggers
      • Commands
      • Common Issues
    • ak47_qb_iclothingv3
      • Installation
    • ak47_qb_switch
      • Installation
      • Commands
    • ak47_qb_crutch
      • Installation
      • Triggers
      • Commands
    • ak47_qb_wanted
      • Installation
      • Triggers
    • ak47_qb_housing
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_qb_cardealer
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_qb_ambulancejob
      • Installation
      • Guideline
      • Items
      • Integration
      • Commands
      • Triggers
      • Exports
    • ak47_qb_gangs
      • Installation
      • Integration
      • Commands
      • Exports
    • ak47_qb_garage
      • Installation
      • Integration
      • Commands
    • ak47_qb_jobgarage
      • Installation
      • Integration
      • Commands
    • ak47_qb_vehiclekeys
      • Installation
      • Integration
      • Commands
    • ak47_qb_carboosting
      • Installation
      • Integration
      • Commands
    • ak47_qb_safezone
      • Installation
      • Integration
      • Commands
    • ak47_qb_inventory
      • Installation
      • Exports
        • Client
        • Server
      • Event Handlers
        • Client
        • Server
      • Commands
      • Guides
        • Custom Stash
        • External Shop
        • Protected Item
        • Convert Items
        • Enable Weapon Wheel
        • Show Info Value
      • Templates
        • Item
        • Weapon
        • Crafting
        • Stash
        • Shop
        • Vending
        • Dumpster
        • Tooltip
      • Modified Scripts
        • LegacyFuel
    • ak47_qb_idcardv2
      • Installation
      • Integration
      • Commands
    • ak47_qb_territories
      • Installation
      • Integration
      • Commands
      • Exports
Powered by GitBook
On this page
  1. QBCore
  2. ak47_qb_inventory
  3. Templates

Item

["water"] = {
    name = "water",
    label = "Water",
    weight = 1000,
    type = "item",
    durability = 1.0,   -- 1 hour
    decay = true,       -- will be removed if item quality reach to 0
    close = true,       -- close inventory on use item
    limit = 100,        -- total limit (only applied to player inventory)
    stacksize = 10,     -- limit for each slot

    client = {
        onUse = function(item)
            --this code will execute on item use

        end,
        onAdd = function(item)
            --this code will execute when you reveive this item

        end,
        onRemove = function(item)
            --this code will execute when item removed from your inventory

        end,
        TriggerEvent = 'Your Trigger Name Here',
        TriggerServerEvent = 'Your Server Trigger Name Here',
    },
    server = {
        onUse = function(source, item)
            --this code will execute on item use

        end,
        onAdd = function(source, slot)
            --this code will execute when you reveive this item

        end,
        onRemove = function(source, slot)
            --this code will execute when item removed from your inventory
            
        end,
        TriggerEvent = 'Trigger Name Here',
        TriggerCientEvent = 'Your Client Trigger Name Here',
    },

    consume = {
        attachment = { -- optional
            prop = 'prop_ld_flow_bottle',
            bone = 18905,
            position = vector3(0.12, 0.008, 0.03),
            rotation = vector3(240.0, -60.0, 0.0)
        },
        --[[
        attachment2 = { -- optional
            prop = 'prop_ld_flow_bottle',
            bone = 18905,
            position = vector3(0.12, 0.008, 0.03),
            rotation = vector3(240.0, -60.0, 0.0)
        },
        ]]
        animation = { -- optional
            dict = 'mp_player_intdrink',
            anim = 'loop_bottle',
            blendIn = 2.0,
            blendOut = 2.0,
            flag = 49,
        },
        progress = { -- optional
            label = 'Drinking Water',
            disable = {
                car = false,
                combat = false,
                move = false,
            }
        },
        status = { -- optional
            hunger = 50, --negative value supported (-50)
            thirst = 50, --negative value supported (-50)
            stress = 25, --negative value supported (-25)
        },

        delay = 5000,
        remove = 0.4, -- set 1 to remove 1 item after consuming. If you set 0.4 then it will remove 40% item quality
    }
},
PreviousTemplatesNextWeapon

Last updated 7 months ago