Configuration

12 min readUpdated 2 weeks ago

Overview

  • shared/config.lua: All settings in a single file

Weather temperature values define the "ambient" temperature. The "perceived" temperature is what the player feels after all modifiers stack.

General

shared/config.lua
1Config.Debug = false
2Config.Locale = 'en'
3Config.ForceShowWidget = true
4Config.DefaultUnit = 'C'
5Config.RequiredItem = false
6
7Config.Widget = {
8    DefaultScale = 1.0,    -- Initial scale for new players (0.5 = half, 2.0 = double)
9    LockPosition = false,  -- Force one position+scale for every player
10    LockedLeft   = '25px', -- CSS left when locked (px or %)
11    LockedTop    = '25px', -- CSS top when locked  (px or %)
12    LockedScale  = 1.0,    -- Scale when locked
13}
  • Debug: Prints state info to console. Enables the /tempclothes debug command
  • Locale: Language code for translations
  • ForceShowWidget: When true (the default), the temperature HUD stays visible even when ml_hud or other scripts try to hide it via the hideweatherhud export
  • DefaultUnit: Default temperature unit. 'C' for Celsius, 'F' for Fahrenheit. Players can toggle with /tempunit; their choice persists via KVP
  • RequiredItem: Item name required in inventory to see the HUD. Set to false for always visible. Example: 'survival_watch'
  • Widget.DefaultScale: Initial HUD scale for new players. 1.0 = normal, 0.5 = half, 2.0 = double
  • Widget.LockPosition: When true, every player sees the HUD at the locked position/scale below and /movetempui is disabled
  • Widget.LockedLeft / Widget.LockedTop: CSS left/top position when locked (px or %)
  • Widget.LockedScale: HUD scale applied when LockPosition = true

Commands

shared/config.lua
1Config.Commands = {
2    moveUI = 'movetempui',
3    toggleUnit = 'tempunit',
4    hideHud = 'hidetemphud',
5    debugClothes = 'tempclothes',
6}
  • moveUI: Opens drag mode to reposition the HUD widget. Press ESC to save and exit
  • toggleUnit: Toggles between Celsius and Fahrenheit. Persists per player via KVP
  • hideHud: Toggles the temperature HUD on/off
  • debugClothes: Prints current clothing drawable IDs and thermal bonuses to F8 console. Only active when Config.Debug = true

Sync & Persistence

shared/config.lua
1Config.SyncInterval = 30000
2Config.EnableDB = true
3Config.ForceLoadOnRestart = true
4Config.ForceLoadTimer = 1000
5Config.RequireGameplayReadyGate = false
  • SyncInterval: Milliseconds between server temperature sync cycles. Keep at 30000 or higher
  • EnableDB: Save temperature to database between restarts. Requires oxmysql
  • ForceLoadOnRestart: Force player state reload when the resource restarts mid-session
  • ForceLoadTimer: Delay in ms before checking player state on resource restart
  • RequireGameplayReadyGate: Optional spawn gate. Leave false (default) and the system starts on the framework player-load event (Bridge.IsPlayerLoaded), which works standalone with no extra dependency. Set true only if your spawn resource (e.g. ml_start) sets the player's gameplayReady state after spawn; the HUD then waits for that signal instead

Temperature & Weather

shared/config.lua
1Config.DefaultTemperature = 22.0
2Config.MinTemperature = -35.0
3Config.MaxTemperature = 55.0
4Config.MaxTempChangePerCycle = 0.1
5Config.TempVariation = 0.05
  • DefaultTemperature: Starting temperature when the database is empty or disabled
  • MinTemperature: Absolute minimum temperature
  • MaxTemperature: Absolute maximum temperature
  • MaxTempChangePerCycle: Maximum degrees the ambient temperature shifts per sync cycle. Lower = smoother transitions
  • TempVariation: Random fluctuation added each cycle

Weather Map

shared/config.lua
1Config.WeatherTemperature = {
2    ["EXTRASUNNY"] = { base = 32.0, min = 28.0, max = 38.0 },
3    ["CLEAR"]      = { base = 26.0, min = 20.0, max = 32.0 },
4    ["SMOG"]       = { base = 28.0, min = 22.0, max = 34.0 },
5    ["NEUTRAL"]    = { base = 22.0, min = 15.0, max = 25.0 },
6    ["CLOUDS"]     = { base = 18.0, min = 12.0, max = 22.0 },
7    ["CLEARING"]   = { base = 20.0, min = 15.0, max = 24.0 },
8    ["OVERCAST"]   = { base = 16.0, min = 10.0, max = 20.0 },
9    ["RAIN"]       = { base = 14.0, min = 8.0, max = 18.0 },
10    ["THUNDER"]    = { base = 12.0, min = 6.0, max = 16.0 },
11    ["FOGGY"]      = { base = 10.0, min = 5.0, max = 15.0 },
12    ["SNOWLIGHT"]  = { base = 0.0, min = -5.0, max = 5.0 },
13    ["SNOW"]       = { base = -4.0, min = -10.0, max = 2.0 },
14    ["XMAS"]       = { base = -6.0, min = -12.0, max = 0.0 },
15    ["BLIZZARD"]   = { base = -15.0, min = -30.0, max = -5.0 },
16    ["HALLOWEEN"]  = { base = 13.0, min = 5.0, max = 20.0 },
17}

Each weather type defines:

  • base: Target temperature the system drifts towards
  • min / max: Range within which temperature fluctuates

These are ambient temperatures. Perceived temperature differs based on all player-specific modifiers.

Damage & Survival

shared/config.lua
1Config.EnableDamageSystem = true
2Config.DamageInterval = 15000
  • EnableDamageSystem: Apply health damage at extreme temperatures
  • DamageInterval: Milliseconds between damage ticks

Thresholds & Values

shared/config.lua
1Config.DamageThresholds = {
2    hot = 42.0,
3    cold = -5.0
4}
5
6Config.DamageValues = {
7    hot = 5,
8    cold = 5
9}
  • DamageThresholds.hot: Perceived temperature above this triggers heatstroke damage
  • DamageThresholds.cold: Perceived temperature below this triggers hypothermia damage
  • DamageValues.hot: Health points removed per tick from heat
  • DamageValues.cold: Health points removed per tick from cold

Status Degradation

shared/config.lua
1Config.StatusDamage = {
2    Enabled = true,
3    HungerRemoveCold = 2.0,
4    ThirstRemoveCold = 0.5,
5    HungerRemoveHot = 0.5,
6    ThirstRemoveHot = 4.0
7}
  • Enabled: Drain hunger/thirst at extreme temperatures
  • HungerRemoveCold: Hunger drain per tick in cold (body burns calories)
  • ThirstRemoveCold: Thirst drain per tick in cold
  • HungerRemoveHot: Hunger drain per tick in heat
  • ThirstRemoveHot: Thirst drain per tick in heat (sweating)

Status damage is computed server-side from config values (zero-trust). Client sends only the condition string ('hot'/'cold'), server applies a 10-second per-player rate limit.

Visual Effects

shared/config.lua
1Config.EnableVisualEffects = true
2Config.Intensity = {
3    start = 0.2,
4    max = 0.8,
5    increment = 0.05
6}
  • EnableVisualEffects: Show screen vignette effects at extreme temperatures
  • Intensity.start: Initial effect intensity when entering danger zone
  • Intensity.max: Maximum intensity cap (0.8 keeps gameplay usable)
  • Intensity.increment: How much intensity increases per damage tick

Wetness & Water

shared/config.lua
1Config.EnableWetnessSystem = true
2Config.Wetness = {
3    IncreaseRate = 0.05,
4    DecreaseRate = 0.005,
5    HeatSourceDryRate = 0.08,
6    TemperatureMalus = -8.0,
7    ExposedVehicleClasses = {
8        [8] = true,   -- Motorcycles
9        [13] = true,  -- Cycles
10        [14] = true,  -- Boats
11    }
12}
  • IncreaseRate: How fast the player gets wet in rain
  • DecreaseRate: Normal drying rate
  • HeatSourceDryRate: Drying rate near fire/heat sources
  • TemperatureMalus: Perceived temperature penalty at 100% wetness. Scales linearly
  • ExposedVehicleClasses: Vehicle classes that do not protect from rain

Swimming

shared/config.lua
1Config.PlayerOnWater = {
2    Enabled = true,
3    TempMalus = -15.0,
4    WetnessIncrease = 0.05
5}
  • Enabled: Apply temperature penalty when swimming
  • TempMalus: Instant perceived temperature reduction while in water
  • WetnessIncrease: Wetness increase rate while swimming

Vehicle Climate Control

Keybind

shared/config.lua
1Config.Keybinds = {
2    climateControl = {
3        defaultKey = 'J',
4        description = 'Open Vehicle Climate Control'
5    }
6}
  • defaultKey: Default key to open climate panel. Rebindable via FiveM keybind settings
  • description: Label shown in FiveM keybind menu

Climate Settings

shared/config.lua
1Config.VehicleClimate = {
2    defaultTemp = 21.0,
3    defaultMode = 'auto',
4    minTemp = 16.0,
5    maxTemp = 28.0,
6    tempChangeStep = 0.5,
7    efficiency = 1.0,
8    dryingBonus = 0.08
9}
  • defaultTemp: Default target temperature
  • defaultMode: Default mode: 'auto', 'heat', or 'ac'
  • minTemp: Minimum settable temperature
  • maxTemp: Maximum settable temperature
  • tempChangeStep: Temperature step per click
  • efficiency: Climate control effectiveness. 1.0 = fast. Lower = slower
  • dryingBonus: Extra drying speed when heater is active

Blacklist

shared/config.lua
1Config.VehicleClimateBlacklist = {
2    classes = {
3        [8] = true,   -- Motorcycles
4        [13] = true,  -- Cycles
5        [14] = true,  -- Boats
6        [21] = true   -- Trains
7    },
8    models = {
9        [`caddy`] = true,
10        [`tractor`] = true
11    }
12}
  • classes: Vehicle classes without climate control
  • models: Specific vehicle model hashes without climate control

Climate UI Themes

shared/config.lua
1Config.ClimateThemes = {
2    default = 'utility',
3    classes = {
4        [0] = 'utility',    -- Compacts
5        [1] = 'utility',    -- Sedans
6        [2] = 'utility',    -- SUVs
7        [3] = 'utility',    -- Coupes
8        [4] = 'retro',      -- Muscle
9        [5] = 'retro',      -- Sports Classics
10        [6] = 'minimal',    -- Sports
11        [7] = 'luxury',     -- Super
12        [9] = 'utility',    -- Off-road
13        [10] = 'utility',   -- Industrial
14        [11] = 'utility',   -- Utility
15        [12] = 'utility',   -- Vans
16        [14] = 'utility',   -- Boats
17        [15] = 'utility',   -- Helicopters
18        [16] = 'utility',   -- Planes
19        [17] = 'utility',   -- Service
20        [18] = 'utility',   -- Emergency
21        [19] = 'utility',   -- Military
22        [20] = 'utility',   -- Commercial
23        [21] = 'utility',   -- Trains
24        [22] = 'minimal'    -- Open Wheel
25    },
26    models = {
27        [`torero`] = 'retro',
28        [`zentorno`] = 'luxury',
29        [`faggio`] = 'retro',
30        [`neon`] = 'luxury',
31        [`raiden`] = 'luxury',
32        [`cyclone`] = 'luxury',
33        [`voltic`] = 'luxury',
34        [`tezeract`] = 'luxury',
35        [`omnisegt`] = 'luxury'
36    }
37}

Available themes: 'utility', 'minimal', 'luxury', 'retro'

  • default: Theme when no class or model match is found
  • classes: Theme per vehicle class ID
  • models: Theme override per model hash. Takes priority over class

Interior Bonus

shared/config.lua
1Config.InteriorBonus = {
2    targetTemp = 22.0,
3    strength = 0.5,
4}
  • targetTemp: Target temperature inside MLOs/interiors
  • strength: Pull strength towards the target. 0.0 = no effect, 1.0 = full pull to target temperature. At 0.5, the perceived temperature moves halfway between current and target

Works both ways, warms the player when it's cold outside, cools when it's hot.

Temperature Objects

shared/config.lua
1Config.TemperatureObjects = {
2    ['prop_beach_fire']          = { radius = 12.0, bonus = 15.0, dynamic = true, force = 1.0 },
3    ['prop_hobo_stove_01']       = { radius = 6.0,  bonus = 10.0, dynamic = true, force = 1.0 },
4    ['gr_prop_gr_hobo_stove_01'] = { radius = 6.0,  bonus = 10.0, dynamic = true, force = 1.0 },
5    ['prop_rub_tyre_01']         = { radius = 8.0,  bonus = 12.0, dynamic = true, force = 1.0 },
6    ['prop_fan_01']              = { radius = 4.0,  bonus = -4.0, dynamic = true, force = 2.0 },
7    ['v_res_coolingfan']         = { radius = 4.0,  bonus = -3.0, dynamic = true, force = 2.0 },
8}

Each entry defines a GTA prop that radiates heat or cold:

  • radius: Detection range in game units
  • bonus: Temperature modifier. Positive = heat, negative = cold
  • dynamic: Scale bonus by distance (closer = stronger). When false, flat bonus within radius
  • force: Falloff exponent. Higher = steeper falloff near the edge

Vehicle Insulation

shared/config.lua
1Config.VehicleModifiers = {
2    excludeCategories = { 8, 13 },
3    categoryBonus = {
4        [0] = 3,   -- Compact
5        [1] = 4,   -- Sedan
6        [2] = 5,   -- SUV
7        [18] = 4,  -- Emergency
8    },
9    hashBonus = {
10        [`rhino`] = 10,
11        [`firetruk`] = 8,
12    }
13}
  • excludeCategories: Vehicle classes with zero insulation (bikes, cycles)
  • categoryBonus: Perceived temperature bonus per vehicle class
  • hashBonus: Bonus override for specific vehicle model hashes

Zones & Blips

Blip Settings

shared/config.lua
1Config.BlipSettings = {
2    sprite = 441,
3    color = { hot = 1, cold = 3, neutral = 2 },
4    scale = 0.8,
5    shortRange = true,
6}
  • sprite: Map blip sprite ID
  • color: Blip color IDs for hot, cold, and neutral zones
  • scale: Blip size
  • shortRange: Only show blip when nearby

Temperature Zones

shared/config.lua
1Config.TemperatureZones = {
2    {
3        type = 'poly',
4        modifier = -10.0,
5        points = { vec3(...), vec3(...), ... },
6        thickness = 20.0,
7        dynamic = true,
8        debug = false,
9        showNotification = true,
10        showBlip = false,
11        blipName = "Freezing Zone"
12    },
13    {
14        type = 'box',
15        modifier = 15.0,
16        coords = vec3(1093.1, -1999.5, 31.0),
17        size = vec3(20.0, 20.0, 10.0),
18        rotation = 0,
19        dynamic = true,
20        debug = false,
21        showNotification = true,
22        showBlip = false,
23        blipName = "Heat Zone"
24    }
25}
  • type: Zone shape: 'poly', 'box', or 'sphere'
  • modifier: Temperature offset. Positive = hotter, negative = colder
  • points: Array of vec3 vertices (poly type)
  • coords: Center position (box/sphere types)
  • size: Dimensions vec3 (box type)
  • radius: Detection radius (sphere type)
  • rotation: Box rotation in degrees
  • thickness: Vertical thickness (poly type)
  • dynamic: Scale modifier by distance from center (box/sphere)
  • debug: Draw zone boundaries (ox_lib debug)
  • showNotification: Notify player on enter/exit
  • showBlip: Add a map blip at the zone
  • blipName: Label for the map blip

Usable Items

shared/config.lua
1Config.ItemBuffs = {
2    ['coffee'] = {
3        buff = 8.0,
4        duration = 10,
5        notification = "item_buff_bag",
6        progressBar = {
7            duration = 5000,
8            label = 'Drinking Coffee...',
9            useWhileDead = false,
10            canCancel = true,
11            disable = { move = false, car = true, combat = true },
12            anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' },
13            prop = { model = `prop_fib_coffee`, pos = vec3(0.01, 0.01, -0.06), rot = vec3(5.0, 5.0, -180.5) }
14        }
15    },
16    ['water'] = {
17        buff = -5.0,
18        duration = 5,
19        notification = "item_buff_icecream",
20        progressBar = {
21            duration = 3000,
22            label = 'Drinking Water...',
23            useWhileDead = false,
24            canCancel = true,
25            disable = { move = false, car = true, combat = true },
26            anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' },
27            prop = { model = `prop_ld_flow_bottle`, pos = vec3(0.03, 0.03, 0.02), rot = vec3(0.0, 0.0, -1.5) }
28        }
29    },
30}

Each item entry:

  • buff: Temperature modifier in degrees. Positive = warming, negative = cooling
  • duration: Buff duration in minutes
  • notification: Locale key for the notification on buff activation
  • progressBar: ox_lib progressBar config: duration (ms), label, useWhileDead, canCancel, disable, anim, prop

Items are registered as usable via Bridge.BindUsableItem on server start. The flow is: server triggers client → client runs progress bar → on completion, client sends confirmItemUse back to server → server verifies inventory, removes item, applies buff.

Clothing Thermal Bonus

shared/config.lua
1Config.ClothesBonus = {
2    ["male"] = {
3        ["hat"]    = { [3] = 1, [5] = 1, ... },
4        ["torso"]  = { [17] = 8, [34] = 6, ... },
5        ["pants"]  = { [4] = 2, [31] = 2, ... },
6        ["shoes"]  = { [12] = 2, [14] = 1, ... },
7        ["tops"]   = { [466] = 2, [497] = 7, [15] = -2, [16] = -2 },
8        ["undershirt"] = {},
9        ["armor"]  = {},
10        ["decals"] = {},
11    },
12    ["female"] = {
13        ["hat"] = {}, ["torso"] = {}, ["pants"] = {}, ["shoes"] = {},
14        ["undershirt"] = {}, ["armor"] = {}, ["decals"] = {}, ["tops"] = {}
15    }
16}

Maps ped drawable variation IDs to temperature bonuses per clothing slot:

  • Positive values = warmth (jackets, boots, winter hats)
  • Negative values = cooling (tank tops, light shirts)
  • Keys are the drawable variation index from GetPedDrawableVariation
  • Slots map to ped component IDs: hat (0), torso (3), pants (4), shoes (6), tops (11), etc.
Debug Clothes

Enable Config.Debug and use /tempclothes in-game to see every drawable ID and its thermal bonus for the current ped.