DH | Breathalyser

Framework Compatibility

DH Breathalyser only works with TMC Framework. You MUST own this framework in order to use this script

Installation

  1. Download DMHBreathalyser from your keymaster

  2. Drag the file into your resources folder and "ensure DHBreathalyser" in your server.cfg

  3. Place the mp3 files from INSTALL/Sounds/ inside your core_game/html/sounds/ folder

Item

Add the breathalyser item into your core/sharedGta.lua

["breathalyser"] = {
        ["label"] = "Breathalyser",
        ["weight"] = 500,
        ["type"] = "item",
        ["image"] = "breathalyser.webp",
        ["unique"] = false,
        ["stackable"] = false,
        ["useable"] = true,
        ["shouldClose"] = true,
        ["description"] = "Check the alcohol level in someones breath"
    },

Configuration


"hanssen:server:drinking"

You need to trigger this event for your alcohol items. inside core_game/config.lua. See example below


    Alcohol = {
        ['alco_holla'] = {
            Value = math.random(15,20),
            AnimGroup = 'drinking',
            Strength = 0.5,
            Action = {
                eventType = 'server', -- server events must be registered as a TMC server event
                eventName = 'hanssen:server:drinking' -- The event to call
            },
        },

Config.Type = "radial"

If you have Config.Type set to "radial" you must integrate our script into your radialmenu. Add this below ["police:search"] in your radialmenu/config.lua. Make sure to change the TMC.Functions.HasItem("breathalyser") to the item you have as required item


    ['police:breathalyse'] = {
        title = "Breathalyse",
        icon = "wine-bottle",
        iconCategory = 'solid',
        functionName = "Hanssen:client:openMenu",
        enableMenu = function()
            return not isDead and TMC.Functions.HasItem('breathalyser')
        end,
    },

You also need to add "police:breathalyse" to your subMenus for "Police Actions" like shown below


    {
        id = 'police',
        displayName = 'Police Actions',
        icon = 'user-police',
        iconCategory = 'duotone',
        enableMenu = function()
            return not isDead and requiredPoliceRanks.Officer[curJob] and curGrade <= requiredPoliceRanks.Officer[curJob]
        end,
        subMenus = {'police:evidenceSearch', "police:frisk", "police:search", "police:breathalyse", "medic:emergencybutton", "police:gsr", "police:openmdt", "police:impound", "police:key", "police:checkstatus", "police:BACTest", "police:cameramenu", "police:checkvin", "police:managecitizen", "police:openRadar", "police:dnaswab", "vehicle:getinheli", "vehicle:putinheli","police:destroyTable"}
    },

Last updated