📖Examples

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

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 clientFunc and serverFunc 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
    }
},

Last updated