Zyke Resources' Products
DiscordStore
  • Introduction
  • Common Issues
    • zyke_lib error
    • Lacking Entitlement
    • UI Not Working
    • Missing Files Via FTP
    • Resource Starting Sequence
    • Item Not Usable
    • Any other issues?
  • FAQ
  • Paid Resources
    • Consumables
      • Resource Description
      • Config
      • Exports & Events
      • Dependencies
      • Changelog
      • Guides
      • Setup
    • Smoking
      • Resource Description
      • Config
      • Exports & Events
      • Examples
      • Dependencies
      • Changelog
      • Test Server
      • Setup
    • Garages
      • Resource Description
      • Config
      • Exports & Events
      • Dependencies
      • Changelog
      • Setup
      • Common Issues
    • Drugdealer
      • Resource Description
      • Config
      • Exports & Events
      • Dependencies
      • Changelog
    • Crafting
      • Resource Description
      • Config
      • Exports & Events
      • Dependencies
      • Changelog
    • Plants
      • Resource Description
      • Config
      • Exports & Events
      • Dependencies
      • Changelog
    • Mugging
      • Resource Description
      • Config
      • Exports & Events
      • Changelog
    • Gangsystem
      • Resource Description
      • Config
      • Exports & Events
      • Examples
      • Dependencies
      • Changelog
  • Free Resources
    • Zyke Lib
      • Resource Description
      • Dependencies
      • Config
      • Setup
    • Status
      • Resource Description
      • Dependencies
      • Changelog
      • Setup
    • Propaligner
      • Resource Description
      • Exports & Events
      • Dependencies
      • Changelog
    • Vending Machines
      • Resource Description
      • Dependencies
      • Changelog
    • Sounds
      • Resource Description
      • Exports & Events
    • Key Minigame
      • Resource Description
      • Exports & Events
      • Changelog
    • Stabwheels
      • Resource Description
      • Dependencies
      • Changelog
    • Burncars
      • Resource Description
      • Dependencies
      • Changelog
    • Catalytic
      • Resource Description
      • Exports & Events
      • Config
      • Dependencies
      • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Paid Resources
  2. Smoking

Examples

A list of examples on how to modify, integrate and overall extend the resource's possibilities.

PreviousExports & EventsNextDependencies

Last updated 8 months ago

Was this helpful?

Custom Smoking Actions

This approach is one example of how to add client- & server-sided actions. We also offer the core functionalities to be modified in unlocked files, allowing for more advanced modifications. The most basic way to add custom actions is by utilizing the and functions available in the config. These functions are ran when exhaling, and provides all relevant information as arguments. We can utilize this information to quickly add actions, such as reducing stress. Below you will find the configuration snippet for a joint containing basic effects. It triggers qb-core's event to reduce stress, and provides it with a value reflecting the amount used. As stated, this can be extended further. By utilizing the provided functions you can run any piece of code you would like. Example of qb-core stress reduction:

["joint"] = {
    type = "joint",
    prop = "p_amb_joint_01",
    effects = {
        clientFunc = function(value, item, metadata)
            TriggerServerEvent('hud:server:RelieveStress', value)
        end
    }
},
clientFunc
serverFunc