๐ ๏ธSetup
This is a detailed setup guide for Drunk System. If you have any questions before making a purchase, you can contact us on Discord
Setting Up the Script
The script is standalone in nature, and you can find the required information in the config itself
You can use BreathAnalyzer with commands or as an item:
["alcohol_tester"] = { ["name"] = "alcohol_tester", ["label"] = "Alcohol Tester", ["weight"] = 0, ["type"] = "item", ["image"] = "alcohol_tester.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "" },
['alcohol_tester'] = { label = 'Alcohol Tester', weight = 0, stack = true, close = true, description = "" },
Events and Exports
Client Sided
TriggerEvent(cs:drunk:openUI)
TriggerEvent(cs:drunk:closeUI)
Triggered Event when drunk level updates:
RegisterNetEvent('cs:drunk:updateLevel', function(updatedLevel) print(updatedLevel) end)
exports['cs_drunk']:isDrunk()
exports['cs_drunk']:GetDrunkLevel()
exports['cs_drunk']:SetDrunkLevel(value)
exports['cs_drunk']:AddDrunkLevel(value)
exports['cs_drunk']:RemoveDrunkLevel(value)
Server Sided
exports['cs_drunk']:GetDrunkLevel(Player_ID)
exports['cs_drunk']:SetDrunkLevel(Player_ID, value)
exports['cs_drunk']:AddDrunkLevel(Player_ID, value)
exports['cs_drunk']:RemoveDrunkLevel(Player_ID, value)
Example
Make your items show the drunk percentage in the drunk tester
ESX
Example of how you can increase the drunk percentage when using an item. You can implement the same logic to other items. I have shown you with the beer item under esx_optionalneeds/server/main.lua

QBCore
Example of how you can increase the drunk percentage when using an item. You can implement the same logic for other items or events. I've demonstrated this with the alcohol use item under
qb-smallresources/client/consumables.lua

OX Inventory
Example of how you can increase the drunk percentage when using an item. You can implement the same logic for other items or events. I've demonstrated this with the beer item under
ox_inventory\data\items.lua

Last updated