Editable Files

client/client.lua

local lang = config.langs[config.lang]

function canStart()
    if config.job.active then
        for i=1, #config.job.jobs do
            if config.job.jobs[i] == PlayerData.job.name then
                return true
            end
        end
        tgiCore.notif(lang.uCantStart, "error", 5000)
        return false
    else
        return true
    end
end

function removeHealth(playerPed)
    SetEntityHealth(playerPed, GetEntityHealth(playerPed) - config.damageDistance.amount)
end

function spawnVehicle(vehicle)
    local plate = GetVehicleNumberPlateText(vehicle)
    TriggerEvent("vehiclekeys:client:SetOwner", plate)
    TriggerEvent("x-hotwire:give-keys", vehicle) 
    TriggerEvent('tgiann-hotwire:give-keys-with-carid', vehicle)
end

function changeClothe(isStarted)
    if not config.clotheEnable then return end
    if isStarted then
        local clotheData = GetEntityModel(PlayerPedId()) == 1885233650 and config.clothe.male or config.clothe.female
        local newList = {}
        for i=1, #clotheData do
            local data = clotheData[i]
            local mainTag = data.isProp and "p" or "c"
            if not newList[mainTag..data.componentId] then 
                newList[mainTag..data.componentId] = {
                    componentId = data.componentId,
                    isProp = data.isProp
                }
            end
            if string.find(data.name, "_2") then
                newList[mainTag..data.componentId].textureId = data.val
            else
                newList[mainTag..data.componentId].drawableId = data.val
            end
        end

        for name, value in pairs(newList) do
            if value.isProp then
                SetPedPropIndex(PlayerPedId(), value.componentId, value.drawableId, value.textureId or 0, 2)
            else
                SetPedComponentVariation(PlayerPedId(), value.componentId, value.drawableId, value.textureId or 0, 2)
            end
        end
    else
        if config.framework == "qb" then
            TriggerServerEvent("qb-clothes:loadPlayerSkin") -- LOADING PLAYER'S CLOTHES
            TriggerServerEvent("qb-clothing:loadPlayerSkin") -- LOADING PLAYER'S CLOTHES - Event 2
            TriggerEvent("qb-radialmenu:ResetClothing")
        else
            TriggerEvent("fivem-appearance:client:reloadSkin")
            tgiCore.cbFunction('esx_skin:getPlayerSkin', function(skin, jobSkin)
                TriggerEvent('skinchanger:loadSkin', skin)
            end)
        end
    end
end

-- weapon_fireextinguisher weapon_tgihose
function giveWeapon(playerPed, weaponHash)
    GiveWeaponToPed(playerPed, weaponHash, 0, false, false)
    SetPedAmmo(playerPed, weaponHash, 10)
    SetCurrentPedWeapon(playerPed, weaponHash, true)
    SetPedInfiniteAmmo(playerPed, true, weaponHash)
end

function removeWeapon(playerPed, weaponHash)
    RemoveWeaponFromPed(playerPed, weaponHash)
end

RegisterNetEvent('tgiann-core:notifData')
AddEventHandler('tgiann-core:notifData', function(text, type, time)
    postUI("app-main", "notify", {
        text = text,
        time = time or 3000
    })
end)

language files

Last updated