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

config.langs.en = {
    blipName = "Fire",
    dollar = "$",
    firefighter = "Firefighter",
    clothes = "Clothes",
    maxPlayerInGrup = "Max players in a team",
    salary = "Salary per extinguished fire ",
    desc = "Alone or in a team with your friends, you save lives by extinguishing destructive fires in the environment and earn money for each fire you extinguish.",
    normalClothe = "Normal",
    jopClothe = "Work",
    leaveTeam = "Leave Team",
    deleteTeam = "Disband Team",
    myTeam = "Your Team",
    closestPlayers = "Players nearby",
    inviteDesc = "A player invited you to his team",
    accept = "Accept",
    reject = "Reject",
    fireList = "Active Fires",
    bigFire = "Big",
    smallFire = "Small",
    normalFire = "Normal",
    pedText = "Firefighter Work",
    pedBlipTExt = "Firefighter work",
    carText = "Take/Leave car",
    carTextWithMoney = "Take/Leave car [Refundable %s%s needed]",
    noInCar = "You are not in the fire truck",
    needStart = "You need to get into your work outfit first",
    sended = "Ä°nvation sended",
    playerOffline = "Player Offline",
    openFireList = "Fire List",
    meter = "Meter",
    mile = "Mil",
    getMoney = "You got $%s for extinguishing the fire!",
    maxGroup = "Your Team reached the maxs number of players",
    maxGroupInviteButton = "The Team you are trying to join is full",
    rButton = "You wore your work clothes! Press ["..config.fireListMenuKey.."] to see the currently available Fires. You can also use a Fire hose if you are near a Fire Truck",
    alreadyStarted = "You are already wearing your work clothes",
    stopped = "You took off your work clothes",
    alreadyNotStarted = "You are already wearing your normal clothes",
    total = "Person",
    invitation = "INVITE",
    markLocation = "Location Marked",
    noMoneyForCar = "You don't have enough cash to get the Fire Truck!",
    lastVehicleWrong = "You can't extinguishe a Fire because the last Car you used wasn't a Fire Truck!",
    tryLater = "Try again later",
    uCantStart = "This job is not for you"
}

Last updated