HALLOWEEN SALE·20% RabattZum Shop

Gefällt dir unsere Doku? Lass uns eine Bewertung auf Google da, damit auch andere von uns erfahren.

Installation

  1. oxmysql muss laufen.
  2. Nach dem Framework starten. Optional alte Notify- und Progress-Resources stoppen (esx_notify, esx_textui, esx_progressbar, progressbar).
  3. Die Framework-UI auf HCS_hud umleiten (siehe unten).
  4. config.lua anpassen (Berechtigungen, Sync-Intervalle, Chat).
  5. Einreise-Zähler anbinden: shared/functions.lua (Functions.GetEinreiseCount, siehe unten).
cfg
ensure oxmysql
ensure es_extended   # oder qb-core / qbx_core
ensure HCS_lib
ensure HCS_hud

Anpassbare Funktionen

In shared/functions.lua:

FunktionSeiteBeschreibung
Functions.GetEinreiseCount()ServerAnzahl wartender Einreisen für die Team-Anzeige. Wird alle Config.Sync.einreise ms abgefragt. nil = Wert behalten, den andere Scripts per SetEinreiseCount setzen.
Functions.GetNeeds()ClientNur Standalone: Hunger und Durst in Prozent (0-100) aus deinem Status-System
lua
function Functions.GetEinreiseCount()
    return exports['your_einreise']:GetWaitingCount()
end

Standalone

Geld, Job und Name kommen aus HCS_lib (CustomBridge) und werden alle Config.Sync.standalone ms abgefragt. Einen Jobwechsel meldest du sofort mit TriggerEvent('HCS:jobChanged') auf dem Client.

Framework-UI umleiten

ESX (es_extended/client/functions.lua)

lua
function ESX.ShowNotification(message, notifyType, length, title)
    exports['HCS_hud']:Notify(title or 'Notification', message, notifyType or 'info', length or 5000)
end

function ESX.ShowAdvancedNotification(sender, subject, msg)
    exports['HCS_hud']:Notify(sender or subject or 'Notification', msg, 'info', 5000)
end

function ESX.ShowHelpNotification(msg, thisFrame)
    if thisFrame then
        exports['HCS_hud']:HelpNotify(msg)
    else
        exports['HCS_hud']:ShowHelpNotify(msg)
    end
end

function ESX.TextUI(text)
    exports['HCS_hud']:ShowHelpNotify(text)
end

function ESX.HideUI()
    exports['HCS_hud']:HideHelpNotify()
end

function ESX.Progressbar(message, length)
    exports['HCS_hud']:StartProgressbar(length or 5000, message)
end

function ESX.CancelProgressbar()
    exports['HCS_hud']:StopProgressbar()
end

QBCore (qb-core/client/functions.lua)

lua
function QBCore.Functions.Notify(text, textype, length)
    local title, message = 'Notification', ''
    local nType = textype or 'primary'
    if type(text) == 'table' then
        title = text.caption or title
        message = text.text or ''
    else
        message = text or ''
    end
    if nType == 'primary' then nType = 'info' end
    exports['HCS_hud']:Notify(title, message, nType, length or 5000)
end

function QBCore.Functions.Progressbar(name, label, duration, _, _, _, _, _, _, onFinish)
    exports['HCS_hud']:StartProgressbar(duration, label)
    if onFinish then
        SetTimeout(duration, onFinish)
    end
end

qb-core/client/drawtext.lua:

lua
local function drawText(text)
    exports['HCS_hud']:ShowHelpNotify(text)
end

local function hideText()
    exports['HCS_hud']:HideHelpNotify()
end