Configs

Config = {}
-- DISCORD : https://discord.gg/zcG9KQj3sa
-- STORE : https://store.devcore.cz/

Config.PlaceItems = {} -- DONT TOUCH --

-- Framework is automatically detected here you have the option to replace the default exports with your own
Config.Export = function()
    if Framework == 'ESX'  then -- ESX
-- insert your esx export here
    return exports['es_extended']:getSharedObject()
--
    elseif Framework == 'QB'  then -- QB or QBX 
-- insert your qb or qbx export here
    return exports['qb-core']:GetCoreObject()
--
    end
end

-- MAIN --
Config.Settings = {
    SaveDB = true, -- Storing placed items in the database (after restarting the server/script the items remain on the ground)
    PlaceDistance = 2.0, -- Maximum distance for placing the item on the ground
    OptionsMenuPosition = 'top-right',
    DisableCombatButtons = true, -- Deactivate combat buttons when consuming
    AutoTake = { -- only for ox_inventory
        enable = false, -- true if the set items are to be used automatically if they are found in the inventory.
        items = { -- The listed items are automatically placed in your hand if they are in inventory and the item is not returned when you press the x button.
            'cola',
            'coffe',
            'sprunk',
            'burger',
            'taco',
            'hotdog',
        },
    },
}

-- BUTTONS --
Config.Buttons = {
    Use = 38, -- Button for consumption
    Place = 38, -- Button to place an item on the ground
    Hide = 105, -- Button to cancel consumption
    Accept = 38, -- Button to confirm that the item will be placed on the ground, Button to confirm the give of the item to the player 
    Take = 38, -- Button to pick up an item from the ground
    Pour = 176, -- Button for pouring drinks into glasses
    Options = 310, -- Button for open options menu
    TestYourself = 310, --Button for testing yourself with alcohol tester
    Back = 105 -- Button to return from the menu to place the item on the ground and give the item to the player
}

Config.Menu = {

    ['MAIN'] = { -- MAIN DRAW MENU
        TextFont = 4,
        TextColor = {255, 255, 255},
        Scale = 0.4,
        Position = {x = 0.50, y = 0.95},
        Background = {
            enable = true,
            color = { r = 35, g = 35, b = 35, alpha = 200 },
        },
    },
    ['STATUS'] = { -- STATUS DRAW MENU
        TextFont = 4,
        TextColor = {255, 255, 255},
        Scale = 0.4,
        Position = {x = 0.984, y = 0.90},
        Background = {
            enable = true,
            color = { r = 35, g = 35, b = 35, alpha = 200 },
        },
    },
    ['OPTIONS'] = { -- OPTIONS DRAW MENU
        TextFont = 4,
        TextColor = {255, 255, 255},
        Scale = 0.4,
        Position = {x = 0.972, y = 0.94},
        Background = {
            enable = true,
            color = { r = 35, g = 35, b = 35, alpha = 200 },
        },
    },

}

-- NOTIFY FUNCTION --
Config.Notify = function(message, type)
    if Framework == 'ESX' then
        -- For your notify remove ESX.ShowNotification(message, 2000, type) and put your export or trigger 
        ESX.ShowNotification(message, 2000, type) -- Default ESX Notify

    elseif Framework == 'QB' then
        -- For your notify remove QBCore.Functions.Notify(message, type) and put your export or trigger 
        QBCore.Functions.Notify(message, type) -- Default QB Notify

    end
end

-- MENU FUNCTION --
Config.CustomMenu = function(text, menuid) -- menuid is only for Realistic needs default menu 

    Draw2DNeedsMenu(text, menuid)

end

-- STATUS -- 
Config.Status = { --Settings for adding food, drink, alcohol and removing stress

    ["FOOD"] = function(data) -- Trigger to increase hunger status
        if Framework == 'ESX' then -- ESX TRIGGER / EXPORT
        
        TriggerEvent('esx_status:add', 'hunger', data.Consume.Status) -- Default triggers work only for esx_basicneeds and esx_status so for proper functioning don't forget to have the scripts enabled

        elseif Framework == 'QB' then -- QB/QBX TRIGGER / EXPORT

        TriggerServerEvent("consumables:server:addHunger", QBCore.Functions.GetPlayerData().metadata["hunger"] + data.Consume.Status)
        end
    end,

    ["DRINK"] = function(data) -- Trigger to increase thirst status
        if Framework == 'ESX' then-- ESX TRIGGER / EXPORT

        TriggerEvent('esx_status:add', 'thirst', data.Consume.Status) -- Default triggers work only for esx_basicneeds and esx_status so for proper functioning don't forget to have the scripts enabled

        elseif  Framework == 'QB' then -- QB/QBX TRIGGER / EXPORT

        TriggerServerEvent("consumables:server:addThirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + data.Consume.Status)

        end
    end,

    ["STRESS"] = function(data) -- Trigger to increase stress status
         if Framework == 'ESX' then -- ESX TRIGGER / EXPORT

            TriggerEvent('esx_status:remove', 'stress', data.Consume.Stress)

        elseif Framework == 'QB' then -- QB/QBX TRIGGER / EXPORT

            TriggerServerEvent('hud:server:RelieveStress', data.Consume.Stress)
        end
    end,

    ["ALCOHOL"] = function(data) -- function to increase Alcohol status
        setAlcohol(data.Consume.Alcohol) 
    end,
}

-- DRUNK SYSTEM -- 
Config.DrunkSystem = {
    TesterItem = 'alcotester', -- Item name for breath test
    ResultTime = 3, -- Duration per breath test result in seconds
    Driving = true, -- Difficult driving under the influence of alcohol
    DisableSprint = true, -- No sprinting while drunk walking
    Ragdoll = true, --true if you want a drunk player to occasionally fall to the ground while walking.
    MaxDrunk = 2.3, -- blood alcohol limit
    Time = 15, -- Effect update time in seconds
    Remove = 0.04, -- Removal of alcohol from the blood after updating the effect
    ShakeCamWhileAiming = true, -- Cam vibration during aiming at Alcohol value above 1.0
    Effect = "spectator5", -- Effect of drunkenness
    VeryDrunkEffect = 'Dax_TripFreefall', -- Effect that appears when the alcohol value is higher than 1.0
    RemoveEffect = 'DrugsDrivingOut', -- The name of the effect that is executed when the drunk effect is above 1.0, each time the effect is reduced, false for disable. https://forge.plebmasters.de/animpostfx
    ShakeCamEffect = true, -- Shake Cam effect after each addition of alcohol.
    DarkEffectIntensity = 100, -- Intensity for slow dark screen effect when drinking alcoholic beverage / false for disable
    DrunkMovement = {
        enable = true,
        Phase = { -- phase for setting the player's movement animation according to the alcohol level
            [1] = {NeedAlcoholValue = 0.4, anim = 'move_m@drunk@slightlydrunk'},
            [2] = {NeedAlcoholValue = 0.7, anim = 'move_m@drunk@a'},
            [3] = {NeedAlcoholValue = 1.0, anim = 'move_m@drunk@verydrunk'},
        }
    },
    MovementTime = 3, -- -- the lower the time you give the harder it will be for the drunk driver to drive the vehicle
    RandomVehicleInteraction = { -- Drunk driving interactions
        {interaction = 10, time = 300}, --turn left and restore wheel pos
        {interaction = 11, time = 300}, --turn right and restore wheel pos
        {interaction = 10, time = 500}, --turn left and restore wheel pos
        {interaction = 11, time = 500}, --turn right and restore wheel pos
    },
}

-- MENU AND TEXT --
Translations = {
    ['MENU'] = {
        ['USE'] =  {tag = '~g~[E]~w~', label = 'USE'},
        ['OPTIONS'] = {tag = '~g~[R]~w~', label = 'OPTIONS'},
        ['TEST_YOURSELF'] = {tag = '~g~[R]~w~', label = 'TEST ON YOURSELF'},
        ['PLACE'] = {tag = '~g~[E]~w~', label = 'PLACE'},
        ['HIDE'] = {tag = '~g~[X]~w~', label = 'HIDE'},
        ['THROW'] = {tag = '~g~[X]~w~', label = 'THROW'},
        ['BACK'] = {tag = '~g~[X]~w~', label = 'BACK'},
        ['ACCEPT'] = {tag = '~g~[E]~w~', label = 'ACCEPT'},
        ['POUR'] = {tag = '~g~[M1]~w~', label = 'POUR'},
        ['TAKE'] = {tag = '~g~[E]~w~', label = 'TAKE'},
    },
    ['TEXT'] = { 
        ['already'] = 'You already have something in your hand',
        ['player_already'] = 'The player is already consuming something',
        ['max_drunk'] = 'Im drunk enough',
        ['add_content'] = 'How much add ml into ',
        ['large_number'] = 'Its not possible to pour more into a glass than will fit',
        ['dont_have_ml'] = 'Thats how many ml you dont have in the bottle',
        ['item_cannot_be_poured'] = 'This item cannot be poured into a glass',
        ['item_in_glass'] = 'There is a different type of drink in the glass than the one you want to pour',
        ['no_near_you'] = 'Theres no one near you',
        ['too_far_away'] = 'You cant put an item this far out',
        ['result'] = 'Result: ',
        ['request_rejected'] = 'The person refused the request for a breath test',
        ['request_text'] = 'Request for breath test',
        ['pour_menu_title'] = 'Choose what you want to pour into the ',
        ['waiting'] = ' Waiting..',
        ['hidden_menu'] = 'You have a hidden menu',
        ['options_menu_title'] = 'Options',
        ['options_autouse_label'] = 'Auto use',
        ['options_place_label'] = 'Place',
        ['options_give_label'] = 'Give',
        ['options_hide_menu_label'] = 'Menu show/hide',
        ['options_hide_label'] = 'Hide',
        ['options_filled_label'] = 'Filled',
        ['options_show_label'] = 'Show',
    },
}

Last updated