βš™οΈConfiguration

Detailed explanation of the config file to adapt the resource to your player needs.

The config.lua

Config = {}
Config.Framework        = 'qb'          -- ('esx')
Config.FrameworkPseudo  = 'qb-core'     -- custom framework name ('es_extended')
Config.Target           = "ox"          -- 'qb' or 'ox' or 'interact' (-- interact is not recommended)
Config.Inventory        = 'ox'          -- 'qb', 'qs', 'tgiann' (you can add yours under client/inventories and server/inventories)
Config.Currency         = '$'           -- '$' or '€' or 'Β£' or 'Ψ―.Ψ₯'
Config.debug            = false          -- prints washing data logs
Config.Props            = {
    ['washmachine']     = { on = 'bkr_prop_prtmachine_dryer_spin', off = 'bkr_prop_prtmachine_dryer_op'},
    ['generator']       = { prop = 'prop_generator_01a'},
    ['fan']             = { prop = 'prop_aircon_s_04a'},
    ['basket']          = { prop = 'v_res_fh_laundrybasket'}, 
    -- in case you don't like the prop or the prop not loading you can change from here : https://forge.plebmasters.de/objects
}
Config.blackmoney       = {
    item    = 'markedbills',    -- item name for blackmoney in your inventory
    worth   = 3250,             -- this worth will be used ONLY on emptying the washmachine !! so the player receive back his blackmoney with this worth.
                                -- if you don't use the metadata worth then just set the worth to 1
    reward  = 'cash'            -- 'cash' or 'bank' (if you want it as a speacial item then just write the item name for example 'wmoney')
}
Config.Maintenance      = {
    Washmachine = {
        item    = 'screwdriverset',
        remove  = true,
        quality = 30, -- increases the pourcentage of the quality by 30%
    },
    Fan = {
        item    = 'screwdriverset',
        remove  = true,
        quality = 30, -- increases the pourcentage of the quality by 30%
    },
    Generator = {
        item    = 'screwdriverset',
        remove  = true,
        quality = 30, -- increases the pourcentage of the quality by 30%
        fuel    = 'wm_fuel', -- the fuel used item to charge the generator Fuel
        level   = 60, -- How much does the fuel charges the generator /100
    },
}

Config.Permissions          = {
    enable = true, -- use or don't use permissions
    -- if this option is true, then players must give access to other players to interact, see and manage the item in the basket ui.
}

Config.RandomSpawn          = false     -- if False then the player can not spawn any of the items only if there is a Generator in the Config.AreaSize ! so the players does not use it on fights as cover and so on... 
Config.AreaSize             = 15.0      -- Z is considered aswell ! In case the props were not placed inside an interior recognized by GetInteriorFromEntity native and not inside a bucket then we need to work with areas ! 
Config.CleanInterval        = 300       -- 300 seconds (5 minutes) (for better graph visibility keep it > 60)
Config.cleanRate            = 1000       -- base amount cleaned per cycle per washmachine
-- How much the device quality degrades per update cycle (in %)
-- Example: quality = math.max(0, quality - Config.qualityDecay)
Config.qualityDecay = 1 
-- How much the fuel in the Generator degrades per update cycle (in %)
Config.FuelDecay = 2  -- better to keep it always > Config.qualityDecay
-- Multiplier for performance calculation
-- Performance = Config.performanceFactor * quality
-- Example: if quality = 80 and performanceFactor = 1.2 β†’ perf = 96
Config.performanceFactor = 1
-- Max Connections and amount for the components : 
Config.Max = {
    washmachine = 10,       -- Washmachine can be connected to max 10 other (fans or washmachines)
    basket      = 5,        -- basket can support up to 5 washmachines
    wash        = 5000,     -- 1 Washmachine can wash only 5000 blackmarket at a time
}
-- Enable or disable max useage of entities per user
Config.MaxUsage = {
    enabled = true,
    washmachine = 10,
    generator = 2,
    fan   = 10, -- must be equal or more than the generators
    basket = 3
}
-- Factors controlling heating and cooling for each device type
-- Users can tweak these to make devices heat up faster or cool more efficiently
Config.Factors = {
    Washmachine = {
        heatingQuality   = 0.4,  -- % of (100 - quality) that contributes to heating
        heatingPerf      = 0.2,  -- % of performance that adds to heating
        coolingQuality   = 0.9,  -- % of quality that contributes to cooling
        coolingHeating   = 0.2,  -- how much heating reduces cooling
    },
    Generator = {
        heatingQuality   = 0.5,  -- generators generate more heat from poor quality
        heatingPerf      = 0.3,  -- performance adds slightly more heating
        coolingQuality   = 0.8,  -- cooling efficiency depends on quality
        coolingHeating   = 0.25, -- heating slightly reduces cooling
    },
    Fans = {
        heatingQuality   = 0.3,  -- fans contribute little to heating
        heatingPerf      = 0.1,  -- minimal heating from performance
        coolingQuality   = 1.0,  -- fans are very effective at cooling
        coolingHeating   = 0.1,  -- heating slightly reduces cooling
    }
}

-- =======================================================
-- EXAMPLE: How it works for a washmachine as an example
-- =======================================================
-- Suppose we have a washmachine with:
--   quality = 100
--   Config.performanceFactor = 1
--   Config.Factors.Washmachine as above

-- Step 1: Compute performance
-- perf = Config.performanceFactor * quality = 1 * 100 = 100

-- Step 2: Compute heating
-- heating = (100 - quality) * heatingQuality + perf * heatingPerf
-- heating = (100 - 100) * 0.4 + 100 * 0.2 = 0 + 20 = 20

-- Step 3: Compute cooling
-- cooling = quality * coolingQuality - heating * coolingHeating
-- cooling = 100 * 0.9 - 20 * 0.2 = 90 - 4 = 86

-- Step 4: Result
-- perf = 100
-- heating = 20
-- cooling = 86
-- Interpretation: A brand new washmachine is very efficient (high perf), stays cool (high cooling), and generates minimal heat (low heating)

-- Users can tweak any of the factors to make devices heat faster, cool slower, or change how performance affects heating


------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------OPTIMISATION PART ----------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
-- Description  : this part is responsable on deleting the not needed props when no players are nearby
-- refreshprops : is the time to check if there is someone near the props or not
-- radius       : is to check how far is the player from the prop if it is < then the prop will be deleted until someone is nearby...
Config.UseBuckets       = false -- Keep it false unless you want to use props inside the apartments and houses that uses buckets (instance) (Not Recommended)
Config.RefreshProps = 15     -- 15 seconds
Config.Radius       = 300.0  -- if the distance between the player and the prop is < 50 then the prop will be deleted.

Last updated