STG ScriptsDocumentation
Hud

Configuration

Every option in STG Hud config/config.lua, from theme, server info and HUD sections to status colors, black money, chat, announcements, seatbelt, nitro, intervals and fuel.

All settings live in stg-hud/config/config.lua. The file stays editable in the escrow version. Restart the resource after a change.

Language

Config.Language = 'en'

Available: en, de, fr, es, pt, it, nl, pl, sv, ar, jp, ko, zh, he, fi, no, cs. To change a text, edit the matching file in stg-hud/locales/. Texts inside the web table are the ones shown on the HUD and in the HUD manager.

Server info

Config.Theme = "blue"
Config.ServerName = { 'SERVER', 'NAME' }
Config.MaxPlayers = 256
Config.ServerDescription = 'Experience the ultimate roleplay adventure with endless possibilities and a thriving community.'
Config.CurrencySymbol = '$'
Config.SpeedType = 'kmh'

Prop

Type

Each theme is a small CSS file in stg-hud/config/themes/. To use your own colors, set Config.Theme = "custom" and edit custom.css. Keep the format of blue.css: the --accent values are hex colors and the -rgb values are three plain numbers such as 76, 207, 255.

The logo on the player card is stg-hud/config/logo.png. Replace it with your own image under the same name.

Features

Every part of the HUD can be turned off for the whole server. A section that is off here is also hidden from the HUD manager.

Config.Features = {
    location = true,
    teamInfo = true,
    statusHealth = true,
    statusArmor = true,
    hideArmorWhenEmpty = true,
    statusFood = true,
    statusWater = true,
    statusStress = true,
    statusStamina = true,
    statusOxygen = true,
    playerInfo = true,
    cash = true,
    bank = true,
    blackMoney = true,
    weapon = true,
    speedometer = true,

    chat = true,
    notifications = true,
    progressBar = true,
    helpNotify = true,
    helpKeys = true,
    announcement = true,
    seatbelt = true,
    nitro = true,
    alwaysMinimap = false,
}

Prop

Type

Status colors

Config.StatusColors = {
    health = '#FF4B4B',
    armor = '#4B87FF',
    food = '#FFB74B',
    water = '#22BCFF',
    stress = '#B83CFF',
    stamina = '#4BFF7A',
    oxygen = '#22D3EE',
}

Config.StatusColorPalette = {
    '#FF4B4B', '#FF7A2F', '#FFB74B', '#FFE74B',
    '#4BFF7A', '#2FD98A', '#22BCFF', '#4B87FF',
    '#7A5CFF', '#B83CFF', '#FF4BC3', '#FF7A9C',
    '#22D3EE', '#8A9BB4', '#FFFFFF', '#1A1A1E',
}
  • StatusColors: the default color of each bar, as a hex code.
  • StatusColorPalette: the swatches offered in the HUD manager. Players can also use the color picker or type any hex code, and their choice overrides the default for them only.

Black money

Config.BlackMoney = {
    type = 'account',
    item = 'black_money',
    markedBillsItem = 'markedbills',
}

Prop

Type

With item or markedbills, the balance refreshes when the inventory changes and every Config.Intervals.blackMoneyItem milliseconds.

Chat

Config.UseChat = {
    ooc = true,
    admin = true,
    team = true,
    adminGroups = {
        ['god'] = 'God',
        ['admin'] = 'Admin',
        ['superadmin'] = 'Super Admin',
    },
}

The HUD chat opens with T and replaces the game's text chat. Every message shows the sender's face, character name and server ID. Messages that start with / run as commands.

Prop

Type

The HUD chat shows the messages players type into it. Messages that other resources send to the chat resource do not appear in it. If your server relies on those, set Config.Features.chat = false.

Announcement

Config.Announcement = {
    command = 'announce',
    targetCommand = 'announceto',
    permission = { 'admin', 'superadmin', 'god' },
    DefaultName = 'System',
    DefaultTitle = 'ANNOUNCEMENT',
    DefaultDuration = 10000,
    UseCharacterNameFallback = true,

    txAdmin = {
        active = true,
        name = 'txAdmin',
        duration = 15000,
    },
}

Prop

Type

Only one banner runs at a time. A new announcement sent while one is on screen is skipped.

announceto is also an ACE restricted command, so the admin needs command.announceto allowed. A server.cfg with add_ace group.admin command allow already covers it.

Seatbelt

Config.Belt = {
    key = 'B',
}

Default key for /seatbelt. Players can change it in their FiveM key bindings. The driver buckles up and cannot leave the vehicle while buckled. A warning chime plays on entering a vehicle, and the belt comes off when the player leaves the vehicle or dies. Motorcycles have no seatbelt.

Nitro

Config.Nitro = {
    boostKey = 'LSHIFT',
    boostMultiplier = 2.0,
    drainRate = 5.0,
    drainInterval = 1000,
    installTime = 5000,
    itemName = 'nos',
    installOutsideOnly = true,
    activationDelay = 500,
}

Using the item installs a full nitro tank (100) on the vehicle. The level is kept on the vehicle, so another driver can use what is left, and the speedometer shows it to the driver.

Prop

Type

Help keys

Config.HelpKeys = {
    keys = {
        { key = 'E', title = 'INTERACT', desc = 'Interact with objects' },
        { key = 'F', title = 'ENTER VEHICLE', desc = 'Enter/exit vehicles' },
        { key = 'F1', title = 'INVENTORY', desc = 'Open your inventory' },
    }
}

Key hints shown on the HUD. Add, remove or edit lines to match your server's keys.

HUD manager

Config.Settings = {
    active = true,
    command = 'hud',
}
  • active: let players open the HUD manager. When false, the command is not registered.
  • command: command that opens it.

In the HUD manager, players turn sections on or off, choose one of three status bar styles, drag sections and single bars to a new position and pick a color for each bar. The layout is saved on their own PC.

Intervals

Config.Intervals = {
    status = 500,
    speedo = 100,
    street = 3666,
    weapon = 500,
    beltWarning = 200,
    nitroVehicleCheck = 500,
    playerCount = 60000,
    moneyChange = 3000,
    blackMoneyItem = 5000,
}

All values are in milliseconds. Lower values update faster and cost a little more client performance.

Prop

Type

Fuel

Config.GetFuel = function(vehicle)
    if not DoesEntityExist(vehicle) then return 0 end
    if GetResourceState('ox_fuel') == 'started' then
        return Entity(vehicle).state.fuel or 0
    end
    -- LegacyFuel, cdn-fuel, ps-fuel, stg-fuel
    return GetVehicleFuelLevel(vehicle) or 0
end

Returns the fuel level the speedometer shows. It reads ox_fuel, LegacyFuel, cdn-fuel, ps-fuel and stg-fuel when they are started, and the game's own fuel level otherwise. To use another fuel script, add a check for it that returns its fuel level from 0 to 100.

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page