Dream Services
Discord Shop
  • Home
    • Welcome
    • FAQ
    • Purchase
    • Keymaster
    • Common issues
  • Support
    • Support Policy
    • 🇺🇸Ticket Rules (EN)
    • 🇩🇪Ticket Rules (GER)
  • Development Guide
    • Create own locale
  • Product
    • 🎰Dream Vending
      • Config Preview
      • Installation
      • Item Use Effect API
    • 🚘Dream Used Cardealer
      • Config Preview
      • Installation
    • ⚡Dream Solarsystems
      • Config Preview
      • Installation
    • 🔌Dream Solarjob
      • Config Preview
      • Installation
    • 🪙Dream Cryptomining
      • Config Preview
      • Installation
      • Create Warehouses
      • Server
        • Exports
          • IsWarehouseAvailable
          • GetAllWarehouses
          • GetPlayerWarehouses
          • GetWarehouse
          • GetWarehouseWorth
          • GetWarehouseRevenue
          • GetWarehouseTransactions
          • GetWarehouseAllServer
          • GetWarehouseAllServerStatus
          • GetWarehouseServer
          • RefreshAllWarehouses
    • 🚙Dream Fakeplates
      • Config Preview
      • IsPlateFake
    • 🐟Dream Fishing
      • Config Preview
    • 🏪Dream Market Stalls
      • Config Preview
    • 🚬Dream Smoking
      • Config Preview
      • Installation
Powered by GitBook
On this page
  • 🔧 Usage
  • ⚙️ Supported Effect Types
  • 🩺 addHeal
  • 💔 removeHeal
  • 🛡️ addArmor
  • 💥 removeArmor
  • 🍔 eatAnim
  • 🥤 drinkAnim
  • 🍻 drunk
  • ⏱️ Delayed Effects
  • 💡 Tips
  1. Product
  2. Dream Vending

Item Use Effect API

🧃Advices to use the item effects

The dream_vending script uses a centralized system (DreamCore.Items) to define how items affect the player when used. This API enables you to easily assign effects to items such as healing, animations, or visual effects like drunkenness.

🔧 Usage

To make an item usable with effects, define it in the DreamCore.Items table with a use function:

DreamCore.Items = {
  ['mocha'] = { -- This is the item name as defined in your items system (e.g., mocha, water, burger)
    use = function(playerId)
      TriggerClientEvent('dream_vending:client:ApplyItemEffects', playerId, {
        -- Effects are passed as a list (array) of tables.
        { type = 'addArmor', amount = 2 }, -- Player will first get 2 armor
        { type = 'drinkAnim', prop = 'ng_proc_coffee_01a' } -- After the armor he drink
      })
    end
  },
  
  -- Add more items ;)
}

💡 Note: If another script manages the item, simply don’t include it in DreamCore.Items.

⚙️ Supported Effect Types

Below is a list of supported type values for the dream_vending:client:ApplyItemEffects event:


🩺 addHeal

Increases the player's health.

{ type = 'addHeal', amount = 10 }

💔 removeHeal

Reduces the player's health.

{ type = 'removeHeal', amount = 10 }

🛡️ addArmor

Increases the player's armor.

{ type = 'addArmor', amount = 10 }

💥 removeArmor

Reduces the player's armor.

{ type = 'removeArmor', amount = 10 }

🍔 eatAnim

Plays an eating animation. Optionally set a prop.

{ type = 'eatAnim', prop = 'prop_cs_burger_01' }

🥤 drinkAnim

Plays a drinking animation. Optionally set a prop.

{ type = 'drinkAnim', prop = 'prop_ecola_can' }

🍻 drunk

Applies a drunk visual and movement effect.

Optional parameters:

  • intensity (float): Camera shake strength

  • veryDrunk (boolean): Changes walking style

{ type = 'drunk', intensity = 1.0, veryDrunk = true }

⏱️ Delayed Effects

You can delay an effect with the timeout parameter (in milliseconds):

{ type = 'addHeal', amount = 10, timeout = 3000 }

💡 Tips

  • You can stack multiple effects in a single item.

  • Try to stay realistic: a whiskey contains more alcohol than just a piña colada.

  • Use props that exist in GTA V (e.g., prop_ecola_can, ng_proc_coffee_01a, etc.).

  • Want custom effects? Add new effectType handling to the ApplyItemEffects event (You need to buy the source version).

PreviousInstallationNextDream Used Cardealer

Last updated 1 day ago

🎰