Editable files

Client Editable.lua

hunger, thirst, stress = 0, 0, 0

function setEngineDamage(vehicle, damage)
    SetVehicleEngineHealth(vehicle, damage)
end

function playSound(name, volume)
    if config.useTgiannSound then
        local data = {
            soundFile = name,
            soundMaxVolume = volume,
        }
        TriggerEvent("tgiann-sounds:play-sound", data)
    else
        TriggerEvent('InteractSound_CL:PlayOnOne', name, volume)
    end
end

function playSyncSound(entity, name, maxDistance, volume)
    if config.useTgiannSound then
        local data = {
            entity = entity,
            soundFile = name,
            checkDistance = true,
            maxDistance = maxDistance, 
            soundMaxVolume = volume,
            sync = true,
        }
        TriggerEvent("tgiann-sounds:play-sound", data) 
    else
        TriggerEvent('InteractSound_CL:PlayOnOne', name, volume)
    end
end

exports("seatbelt", function()
    return seatbelt
end)

exports("inVehicle", function()
    return inVehicle
end)

if config.framework == "esx" then
    -- Need Last version ESX STATUS - https://github.com/esx-framework/esx-legacy/tree/main/%5Besx_addons%5D/esx_status
    AddEventHandler('esx_status:onTick', function(data)
        for i=1, #data do
            if data[i].name == "hunger" then
                hunger = data[i].percent
            elseif data[i].name == "thirst" then
                thirst = data[i].percent
            end
        end
    end)
elseif config.framework == "qb" then
    RegisterNetEvent('hud:client:UpdateNeeds')
    AddEventHandler('hud:client:UpdateNeeds', function(newHunger, newThirst)
        hunger = newHunger / 100
        thirst = newThirst / 100
    end)

    RegisterNetEvent('hud:client:UpdateStress')
    AddEventHandler('hud:client:UpdateStress', function(newStress)
        stress = newStress
    end) 
end

RegisterNetEvent("tgiCore:Client:OnPlayerLoaded")
AddEventHandler("tgiCore:Client:OnPlayerLoaded", function()
    firstLogin()
end)

--PMA Voice Level
talkStatus = false -- value set to true by pma if player is speaking ( NetworkIsPlayerTalking(playerId) )
RegisterNetEvent('pma-voice:setTalkingMode')
AddEventHandler('pma-voice:setTalkingMode', function(lvl)
    SendNUIMessage({action = 'voicelvl', lvl = lvl})
end)

if config.enableShowMoney then
    RegisterKeyMapping('+showmoney'..config.showMoneyKey, config.langs[config.lang].showMoney, 'keyboard', config.showMoneyKey)
    RegisterCommand('+showmoney'..config.showMoneyKey, function()
        TriggerEvent("tgiann-modernHud:showmoney", true)
    end)
    RegisterCommand('-showmoney'..config.showMoneyKey, function()
        TriggerEvent("tgiann-modernHud:showmoney", false)
    end)
end

Client moneyEditable.lua

cashAmount = 0
RegisterNetEvent("tgiann-modernHud:showmoney")
AddEventHandler("tgiann-modernHud:showmoney", function(isOpen)
    if PlayerData.money then
        PlayerData = exports["tgiann-core"]:getPlayerData()
        if config.framework == "qb" then
            cashAmount = tgiCore.round(PlayerData.money.cash)
        elseif config.framework == "esx" then
            cashAmount = tgiCore.round(PlayerData.money)
        end

        SendNUIMessage({
            action = "money",
            money = cashAmount,
            isOpen = isOpen
        })
    end
end)

--QB
RegisterNetEvent("hud:client:OnMoneyChange")
AddEventHandler("hud:client:OnMoneyChange", function(type, amount, isMinus, newAmount)
    if type == "cash" then
        cashAmount = tgiCore.round(newAmount)
        SendNUIMessage({
            action = "moneyUpdate",
            money = amount,
            newCashAmount = cashAmount,
            isMinus = isMinus
        })
    end
end)

Last updated