STG ScriptsDocumentation
Admin Menu

Configuration

Every option in STG Admin Menu config.lua and settings.lua, from the menu key and tickets to plates, noclip, Discord avatars and webhook logs.

General settings live in stg-admin/config.lua, Discord and webhook settings in stg-admin/settings.lua. Both files stay editable in the escrow version. Restart the resource after a change.

Framework

Config.Framework = "auto"

auto looks for qbx_core, then qb-core, then es_extended and uses the first one that is running. Set esx, qb or qbox to force one.

Language

Config.Language = "en"

Available: en, de, fr, es, pt, it, nl, pl, sv, ar, jp, zh, bg. To change a text, edit the matching file in stg-admin/locales/.

General

Config.isWeaponItem = true
Config.SpeedType = "km/h"
Config.DefaultAdminStatus = true
Config.DeleteTicketAfterClose = true

Prop

Type

Permanent admins

Config.Admins = {
    {
        id = "discord:397358061548863498",
        rank = "god",
    },
}

Staff that are always loaded from the config and cannot be removed in the menu. Replace the example entry with your own identifier. See Permissions.

Notifications

Config.Notify = function(message, type, duration)
    lib.notify({
        title = getMessage('notify_title'),
        description = message,
        type = type,
        duration = duration or 3000
    })
end

Runs on the client for every message the script shows. Replace the body to use your own notification system. Announcements from the dashboard always use ox_lib notifications.

Clothing menu

Config.OpenClothing = function()
    if GetResourceState('illenium-appearance') == 'started' then
        TriggerEvent('illenium-appearance:client:openClothingShop', false)
    else
        -- your code
    end
end

Runs on the target player's client when staff press Open Clothing Menu. Add your own clothing script in the else branch.

Vehicle keys

Config.GiveKey = function(vehicle, plate)
    if GetResourceState('qb-vehiclekeys') == 'started' then
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
    elseif GetResourceState('wasabi_carlock') == 'started' then
        exports.wasabi_carlock:GiveKey(plate)
    elseif GetResourceState('MrNewbVehicleKeys') == 'started' then
        exports.MrNewbVehicleKeys:GiveKeysByPlate(plate)
    else
        -- add other key systems here
    end
end

Runs on the staff member's client after a vehicle is spawned from the menu. Add your key script in the else branch.

Opening the menu

Config.Command = {
    active = true,
    command = "admin",
}

Config.Key = {
    active = true,
    key = "F6",
}

Prop

Type

The menu only opens for staff, after their character has loaded.

Revive events

Config.ReviveTriggers = {
    "esx_ambulancejob:revive",
    "hospital:client:Revive"
}

Client events sent to the player on Revive, and to everyone on Revive All Players. Every event in the list is sent, so add the revive event of your ambulance job and remove the ones you do not use.

Noclip

Config.NoclipControls = {
    turnLeft = 34,
    turnRight = 35,
    goForward = 32,
    goBackward = 33,
    changeSpeed = 21,
    exitNoclip = 177
}

Config.noclipSpeeds = {
    { label = "verySlow", speed = 0},
    -- ...
    { label = "maxSpeed", speed = 25}
}

Control ids from the FiveM controls list.

  • turnLeft, turnRight, goForward, goBackward: move while noclip is on. Forward and backward follow the camera, so look up or down to climb or sink.
  • exitNoclip: the key shown on the on screen hint. Backspace always ends noclip.
  • changeSpeed and Config.noclipSpeeds are not used in this version. Holding Left Shift doubles the speed.

Fuel

Config.getFuel = function(vehicle)
    if vehicle then
        if GetResourceState('LegacyFuel') == 'started' then
            return exports["LegacyFuel"]:GetFuel(vehicle)
        else
            return 100
            -- your code
        end
    else
        return 100
    end
end

Fuel level shown in the Vehicles tab, from 0 to 100. Replace return 100 with your fuel script's export.

Plates

Config.Plate = {
    Letters = 3,
    Numbers = 3,
    UseDash = true,
    Prefix = "STG",
    UsePrefix = true
}

Used when staff leave the plate empty while spawning a vehicle.

Prop

Type

A GTA plate holds 8 characters. The default settings build a 10 character plate (STGABC-123) that the game cuts off. Lower Letters or Numbers, or turn off UseDash or UsePrefix, so the total stays at 8 or less.

Tickets

Config.Ticket = {
    active = true,
    command = "ticket",

    categories = {
        {id = "bug", label = "Bug"},
        {id = "suggestion", label = "Suggestion"},
        {id = "question", label = "Question"},
        {id = "other", label = "Other"},
    }
}

Prop

Type

Online staff get a notification with a sound for every new ticket and answer it from the Support/Ticket tab. Tickets are kept in memory, so they are cleared when the resource restarts.

Ranks

Config.Permissions = {
    ["god"] = {
        label = "God",
        perms = {
            dashboard = { announcement = true, ... },
            players = { revive = true, ... },
            -- ...
        }
    },
    ["admin"] = { ... },
    ["moderator"] = { ... },
    ["player"] = {
        label = "Player"
    }
}

The ranks and what each one may press. Every key is explained on the Permissions page.

QBOX items

function addItemQbox(source, item, count)
    print("^2[STG Admin] ^3AddItemQbox function called. Please implement your item adding logic stg-admin/config.lua.^0")
end

On QBOX, Give Item and Give Weapon use ox_inventory. This function only runs when ox_inventory is not started. Replace the body with your inventory's add item export.

Discord and webhooks

Settings = {
    botToken = "",

    webhooksEnabled = true,
    webhooks = {
        ban = "",
        unban = "",
        kick = "",
        -- ...
        screenshot = "",
        announcement = ""
    }
}

This block lives in stg-admin/settings.lua, which only the server loads.

Prop

Type

WebhookSent when
ban, unban, kickA player is banned (online or offline), unbanned or kicked
kickAll, reviveAllKick All Players or Revive All Players is used
reviveA player is revived
teleportA player is brought to staff with Bring
giveMoney, giveItem, giveWeapon, changeJobMoney, an item or a weapon is given, or a job is changed
deleteVehicleA car is removed from the owned vehicles table
spawnVehicleA car is added to the owned vehicles table
deleteAllVehicles, deleteAllObjects, deleteAllPedsThe matching dashboard button is used
godmode, noclipStaff toggle their own god mode or noclip
screenshotA screenshot is taken
announcementAn announcement is sent

The Screenshot button needs screenshot-basic and a webhook in screenshot. The image is uploaded to that webhook and opened for the staff member, even when webhooksEnabled is false.

Still having trouble?

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

Get help on Discord

On this page