🔧Config

Explanations for all config values.

General Information

Additional Settings If there is a feature within the script that you can't find in the script's config, there is a chance that the configuration lies within Zyke Lib. Keymapping When stated to utilize keymapping, the key can be changed in your GTA / FiveM keybinds. Keys All available keys can be found here. Prop Models All prop models can be found here. Ped Models All ped models can be found here. Blip Settings All blip settings can be found here.

Settings

All basic settings.

language

Set this to a language file available. By default there is "en". You can create your own translations in the locales folder and set your language here. Example:

language = "en"

lighterItem

Simply the lighter item that is required to light your cigarettes, joints, cigars and bong.

Example:

lighterItem = "lighter"

maxInhale

The max length you can hold you breath for, in seconds. Minimum required value is 0.1. It is recommended to keep this around 2.5-4.0. Example:

maxInhale = 3.0

cancelBenefitsOnMaxHit

When you inhale for the entire duration, you still start coughing. If this option is set to true, all the effects that are usually applied will be removed. Note that the visual effects are unchanged by this value. Example:

cancelBenefitsOnMaxHit = true

firstTimeUseDisclaimer

When you use a smokeable item for the first time, a popup will appear displaying all the default keybinds. This will only appear once, and when closed down it is saved on the client. You can reset this by running /reset_disclaimer, or when you reinstall your game. All keys used in the resource can be changed in your FiveM keybind settings, constantly displaying them on the selected keys on screen was a design choice we didn't think would fit. You can also disable this disclaimer by setting the value to false, however, it is very much recommended to keep it as true to avoid any confusion. Example:

firstTimeUseDisclaimer = true

keys

The default keys for all actions. These are all configurable in your FiveM keybind settings. Example:

keys = {
    ["hit"] = "E",
    ["switchPlacement"] = "H",
    ["cancel"] = "X",
    ["transferItem"] = "J",
},

passiveSmoke

Configurable values for the passive smoke particles that appear for different types of smokeables. Example:

passiveSmoke = {
    joint = 0.03,
    cigarette = 0.03,
    cigar = 0.05,
},

exhaleSmoke

Configurable values for the exhale smoke particles that appears for different types of smokeables. Example:

exhaleSmoke = {
    joint = 0.17,
    cigarette = 0.15,
    cigar = 0.18,
    bong = 0.3,
    vape = 0.25,
},

decay

When joints, cigarettes or cigars are lit, there is a decay that takes place every second. It is a small amount that gets removed from the total amount to simulate the passive burning. Example:

decay = {
    joint = 0.1,
    cigarette = 0.1,
    cigar = 0.2,
},

useMultiplier

This configuration allows you to change the base amount that will be used. A value of 1.0 is the default, and allows for 100 seconds of inhaling. Modifying this multiplier will change how everything for that drug is calculated. All values will be multiplied by the useMultplier, this allows you to configure the smoking length as you please, whilst also having predictible effects. Please see our examples below. The overall takeaway is that values are multiplied by the useMultiplier. Multiplier : 1.0

  • 100 seconds of inhaling.

  • With an effect set as 60.0, you will receive 0.6 of said effect per second.

Multiplier : 2.0

  • 50 seconds of inhaling.

  • With an effect set as 60.0, you will receive 1.2 of said effect per second.

Multiplier : 0.5

  • 200 seconds of inhaling.

  • With an effect set as 60.0, you will receive 0.3 of said effect per second.

Multiplier : 0.1

  • 1000 seconds of inhaling.

  • With an effect set as 60.0, you will receive 0.06 of said effect per second.

Example:

useMultiplier = {
    joint = 1.4,
    cigarette = 1.6,
    cigar = 1.3,
    bong = 1.0,
    vape = 0.4,
},

propPosition

Various settings for the positions of the props spawning. It is important to modify these values when adding or changing the props to ensure that props are correctly aligned. If you are using the script as is, there is no need to care for these values.

particles

Various settings for particles. Example:

particles = {
    dict = "core",
    name = "exp_grd_bzgas_smoke",
    offsets = {
        ["p_amb_joint_01"] = {x = -0.11, y = 0.0, z = 0.0},
        ["ng_proc_cigarette01a"] = {x = -0.07, y = 0.0, z = 0.0},
        ["prop_cigar_03"] = {x = -0.01, y = 0.0, z = 0.0},
    }
},

particles.dict

The particle dictionary, also known as category. Example:

dict = "core"

particle.name

The name for the particle. Make sure this particle exists within the dictionary. Example:

name = "exp_grd_bzgas_smoke"

particles.offsets

Particle offsets for the different props, deciding where the particles spawn. Make sure to configure all props you add. Note that this does not count for vapes or bongs.

screenEffects

Various settings for the screen effects. The screen effects work in a queue. This means that if you have smoked different substances, you will experience them all, for however long you consumed the smokeable for. Example:

screenEffects = {
    maxDuration = 600,
    minAmount = 100.0,
    multiplier = 7.5,
    decay = 1.0,
},

screenEffects.maxDuration

The total and max duration for your effects. Note that this combined all your queued effects to determine if you can add more. Example:

maxDuration = 600

screenEffects.minAmount

The minimum total amount of seconds you need queued for your effects to start playing. This amount is recommended to be rather high to prevent instant highs that fade if you're not constantly smoking. It also ensures that you consume a good amount of product before a high can be felt. Example:

minAmount = 100.0

screenEffects.multiplier

Multiplier for the screen effect time based on the amount you used, can be configured to your server's needs but overall serves as a way to better display the high felt when smoking, not when you consume an unreal amount of the product. Example:

multiplier = 7.5

screenEffects.decay

If you stop smoking, we want to slowly remove the product from your system. Every 5 seconds, the decay is removed from your screen effect time. This approach ensures that you won't get hit with a high when you consume a very small amount of product once significant time has passed. Example:

decay = 1.0

vapeExtras

Various extra settings specifically for vapes. Example:

vapeExtras = {
    batteryItem = "vape_battery",
    batteryDrain = 0.12,
    items = {
        ["vape_flavour_capsule"] = {
            effects = {...}
        }
    }
},

vapeExtras.batteryItem

The item used to refill the battery in your vape. Example:

batteryItem = "vape_battery"

vapeExtras.batteryDrain

The battery drained per second when inhaling. Example:

batteryDrain = 0.12

vapeExtras.items

Available flavour packs for the vape. Each flavour allows for a different effect when consumed. Each flavour has access to the same effect properties as any of the cigarettes, joints and cigars. Example:

items = {
    ["vape_flavour_capsule"] = {
        effects = {...}
    }
}

bongExtras

Various extra settings specifically for bongs. Example:

bongExtras = {
    waterItem = "bong_water",
    waterDrain = 0.5,
    items = {
        ["weed_nugget"] = {
            effects = {...}
        }
    }
},

bongExtras.waterItem

The item used to refill the water in your bong. Example:

waterItem = "bong_water"

bongExtras.waterDrain

The water drained per second when inhaling. Example:

waterDrain = 0.5

bongExtras.items

Available products to fill the bong with and smoke. Each product allows for a different effect when consumed. Each product has access to the same effect properties as any of the cigarettes, joints and cigars. Example:

items = {
    ["weed_nugget"] = {
        effects = {...}
    }
}

sound

Various sound files for different actions. Make sure that you have all of these files in your zyke_sounds resource. Example:

sound = {
    ["exhale"] = {
        name = "exhale.wav",
        volume = 0.2,
        distance = 2.0,
    },
    ["inhale"] = {
        name = "inhale.wav",
        volume = 0.05,
        distance = 2.0,
    },
    ...
}

sounds.name

The file sound name that will be played. Example:

name = "exhale.wav"

sounds.volume

The max volume that can be played. This volume is affected by the distance to the source. Example:

volume = 0.2

sounds.distance

The max distance you can hear the sounds playing. Example:

distance = 2.0

packs

Usable packs containing cigarettes, joints or cigars. Create these based on your needs, when given by any means our resource makes sure the required data exists for them item. Drag the pack to ues, and you will receive the item configured to be given. Example:

packs = {
    ["cigarette_pack"] = {
        itemToGive = "cigarette",
        amount = 20,
    },
    -- Feel free to add more types of packs below
}

packs[x].itemToGive

The item to give when the pack is used. Example:

itemToGive = "cigarette"

packs[x].amount

The initial amount for the pack, will be subtracted when the pack is used. Example:

amount = 20

itemDataIndicators

Various styling properties you can change to easily personalize the design of the UI. Example:

itemDataIndicators = {
    color = "var(--blue)",
    animation = {
        ["finished"] = {
            opacity = 1,
            bottom = "0.5rem",
        },
        ["exit"] = {
            opacity = 0,
            bottom = "-2rem",
        }
    },
    style = {
        transform = "translateX(calc(-50% - 17rem))",
    }
},

Cigarettes

Available cigarettes to smoke. Example:

Config.Cigarettes = {
    ["joint"] = {
        type = "joint",
        prop = "p_amb_joint_01",
        effects = {...}
    },
    ...
}

Cigarettes[x].type

The type of cigarette. Available types: joint, cigarette & cigar Example:

type = "joint"

Cigarettes[x].prop

The prop for your cigarette. Example:

prop = "p_amb_joint_01"

Cigarettes[x].effects

Various effects available to apply after inhaling. All these effects are applied based on the amount used, see useMultiplier for more information. Example:

effects = {
    health = 50.0,
    armor = 25.0,
    screenEffect = "BikerFilter",
    clientFunc = function(value, item, metadata)
        -- print("Total amount has been removed:", value)
        -- print("Used item", item)
    end,
    serverFunc = function(value, item, metadata)
        -- print("Total amount has been removed:", value)
        -- print("Used item", item)
    end
}

Cigarettes[x].effects.health

The total health you will gain when consuming an entire product. Example:

health = 50.0

Cigarettes[x].effects.armor

The total armor you will gain when consuming an entire product. Example:

armor = 25.0

Cigarettes[x].effects.screenEffect

The screen effect that will be played if you reach the minimum amount, more information can be found here: screenEffects.minAmount. You can find more effects here. Example:

screenEffect = "BikerFilter"

Cigarettes[x].effects.clientFunc

A client function that is ran after inhaling, providing you with the amount used and the current item, or current flavour/product, that was used. This can be used to incorporate other status systems creating external effects. Example:

---@param value number
---@param item string
---@param metadata table
clientFunc = function(value, item, metadata)
    -- print("Total amount has been removed:", value)
    -- print("Used item", item)
end,

Cigarettes[x].effects.serverFunc

A server function that is ran after inhaling, providing you with the player id that triggered the function, the amount used and the current item, or current flavour/product, that was used. This can be used to incorporate other status systems creating external effects. Example:

---@param playerId integer
---@param value number
---@param item string
---@param metadata table
serverFunc = function(playerId, value, item, metadata)
    -- print("Server function triggered by", playerId)
    -- print("Total amount has been removed:", value)
    -- print("Used item", item)
end,

Refillables

Various items and props for bongs and vapes. Example:

Config.Refillables = {
    ["bong"] = {
        type = "bong",
        prop = "prop_bong_01",
    },
    ["vape"] = {
        type = "vape",
        prop = "ba_prop_battle_vape_01",
    },
    ... Add more items with different props
}

LighterProps

Customize the lighter prop model and it's attachment properties, allowing a range of lighters to all fit perfectly with some adjustments. Example:

Config.LighterProps = {
    ["lighter"] = {
        model = "p_cs_lighter_01",

        ["hand"] = {
            ["bong"] = {
                bone = 64016,
                offset = {x = 0.01, y = -0.03, z = -0.02},
                rotation = {x = -50.0, y = 50.0, z = -50.0},
            },
            ...
        },

        ["mouth"] = {
            ["cigarette"] = {
                bone = 64016,
                offset = {x = 0.0, y = -0.03, z = -0.02},
                rotation = {x = -50.0, y = 50.0, z = -50.0},
            },
            ...
        }
    },
    -- Add other lighter props here
}

Last updated