Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/afk.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

local isLoggedIn = LocalPlayer.state.isLoggedIn
local checkUser = true
local prevPos, time = nil, nil
Expand Down
2 changes: 1 addition & 1 deletion client/carwash.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

local washingVeh, listen = false, false
local washPoly = {}

Expand Down
1 change: 0 additions & 1 deletion client/consumables.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-- Variables

local QBCore = exports['qb-core']:GetCoreObject()
local alcoholCount = 0
local healing, parachuteEquipped = false, false
local currVest, currVestTexture = nil, nil
Expand Down
17 changes: 14 additions & 3 deletions client/cruise.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

local vehicleClasses = {
[0] = true,
[1] = true,
Expand Down Expand Up @@ -31,9 +31,20 @@ local function triggerCruiseControl(veh)
if speed > 0 and GetVehicleCurrentGear(veh) > 0 then
speed = GetEntitySpeed(veh)
local isTurningOrHandbraking = IsControlPressed(2, 76) or IsControlPressed(2, 63) or IsControlPressed(2, 64)
if GetResourceState('qb-fuel') == 'started' then
if exports['qb-fuel']:GetFuel(veh) <= 10 then
QBCore.Functions.Notify(Lang:t('cruise.not_Enough_Fuel'), 'error')
return
end
end
if GetResourceState('LegacyFuel') == 'started' then
if exports['LegacyFuel']:GetFuel(veh) <= 10 then
QBCore.Functions.Notify(Lang:t('cruise.not_Enough_Fuel'), 'error')
return
end
end
TriggerEvent('seatbelt:client:ToggleCruise', true)
QBCore.Functions.Notify(Lang:t('cruise.activated'))

CreateThread(function()
while speed > 0 and GetPedInVehicleSeat(veh, -1) == ped do
Wait(0)
Expand Down Expand Up @@ -76,4 +87,4 @@ RegisterCommand('togglecruise', function()
end
end, false)

RegisterKeyMapping('togglecruise', 'Toggle Cruise Control', 'keyboard', 'Y')
RegisterKeyMapping('togglecruise', 'Toggle Cruise Control', 'keyboard', 'Y')
1 change: 0 additions & 1 deletion client/discord.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local QBCore = exports['qb-core']:GetCoreObject()

CreateThread(function()
while Config.Discord.isEnabled do
Expand Down
34 changes: 6 additions & 28 deletions client/fireworks.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

local fireworkTime = 0
local fireworkLoc = nil
local fireworkList = {
Expand Down Expand Up @@ -35,42 +35,20 @@ local fireworkList = {
}
}

local function DrawText3D(x, y, z, text)
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(true)
SetTextColour(255, 255, 255, 215)
BeginTextCommandDisplayText('STRING')
SetTextCentre(true)
AddTextComponentSubstringPlayerName(text)
SetDrawOrigin(x, y, z, 0)
EndTextCommandDisplayText(0.0, 0.0)
local factor = (string.len(text)) / 370
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
ClearDrawOrigin()
end

local function fireworkText()
CreateThread(function()
while true do
Wait(0)
if fireworkTime > 0 and fireworkLoc then
DrawText3D(fireworkLoc.x, fireworkLoc.y, fireworkLoc.z, Lang:t('firework.time_left') .. fireworkTime)
end
if fireworkTime <= 0 then break end
end
end)
end

local function startFirework(asset, coords)
fireworkTime = Config.Fireworks.delay
fireworkLoc = { x = coords.x, y = coords.y, z = coords.z }
local pedCoords = GetEntityCoords(PlayerPedId())
CreateThread(function()
fireworkText()
while fireworkTime > 0 do
if #(pedCoords - vector3(coords.x, coords.y, coords.z)) < 50.0 then
exports['qb-core']:DrawText(Lang:t('firework.time_left') .. ' ' .. fireworkTime)
end
Wait(1000)
fireworkTime -= 1
end
exports['qb-core']:HideText()
UseParticleFxAssetNextCall('scr_indep_fireworks')
for _ = 1, math.random(5, 10), 1 do
local firework = fireworkList[asset][math.random(1, #fireworkList[asset])]
Expand Down
2 changes: 1 addition & 1 deletion client/seatbelt.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

local seatbeltOn = false
local harnessOn = false
local harnessHp = Config.HarnessUses
Expand Down
2 changes: 1 addition & 1 deletion client/tackle.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()


local function tackleAnim()
local ped = PlayerPedId()
Expand Down
4 changes: 4 additions & 0 deletions client/vehiclepush.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ CreateThread(function()
icon = 'fas fa-wrench',
label = 'Push Vehicle',
action = function(entity)
if GetEntityHealth(entity) > Config.DamageNeeded then
QBCore.Functions.Notify(Lang:t('pushcar.notDamaged'), 'error')
return
end
TriggerEvent('vehiclepush:client:push', entity)
end,
distance = 1.3
Expand Down
2 changes: 1 addition & 1 deletion client/vehicletext.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()


CreateThread(function()
for _, v in pairs(QBCore.Shared.Vehicles) do
Expand Down
2 changes: 1 addition & 1 deletion config.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Config = {}

QBCore = exports['qb-core']:GetCoreObject()
Config.UseTarget = GetConvar('UseTarget', 'false') == 'true' -- Use qb-target interactions (don't change this, go to your server.cfg and add `setr UseTarget true` to use this and just that from true to false or the other way around)
Config.PauseMapText = '' -- Text shown above the map when ESC is pressed. If left empty 'FiveM' will appear
Config.HarnessUses = 20
Expand Down
8 changes: 5 additions & 3 deletions locales/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ local Translations = {
cruise = {
unavailable = "Tempomat nicht verfügbar",
activated = "Tempomat aktiviert",
deactivated = "Tempomat deaktiviert"
deactivated = "Tempomat deaktiviert",
not_Enough_Fuel = "Nicht genug Treibstoff"
},
editor = {
started = "Aufnahme gestartet!",
Expand All @@ -46,7 +47,7 @@ local Translations = {
firework = {
place_progress = "Feuerwerk platzieren...",
canceled = "Abgebrochen...",
time_left = "Feuerwerk startet in ~r~"
time_left = "Feuerwerk startet in "
},
seatbelt = {
use_harness_progress = "Renngurt anlegen",
Expand All @@ -57,7 +58,8 @@ local Translations = {
teleport_default = 'Aufzug benutzen'
},
pushcar = {
stop_push = "[E] Schieben beenden"
stop_push = "[E] Schieben beenden",
notDamaged = "Das Fahrzeug ist nicht beschädigt genug, um es zu schieben!",
}
}

Expand Down
8 changes: 5 additions & 3 deletions locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ local Translations = {
cruise = {
unavailable = "Cruise control unavailable",
activated = "Cruise control activated",
deactivated = "Cruise control deactivated"
deactivated = "Cruise control deactivated",
not_Enough_Fuel = "Not enough fuel"
},
editor = {
started = "Started Recording!",
Expand All @@ -46,7 +47,7 @@ local Translations = {
firework = {
place_progress = "Placing firework...",
canceled = "Canceled...",
time_left = "Firework launch in ~r~"
time_left = "Firework launch in "
},
seatbelt = {
use_harness_progress = "Attaching Race Harness",
Expand All @@ -57,7 +58,8 @@ local Translations = {
teleport_default = 'Use Elevator'
},
pushcar = {
stop_push = "[E] Stop Pushing"
stop_push = "[E] Stop Pushing",
notDamaged = "The vehicle isn't damaged enough to push!",
}
}

Expand Down
8 changes: 5 additions & 3 deletions locales/es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ local Translations = {
cruise = {
unavailable = "Control de crucero no disponible",
activated = "Control de crucero activado",
deactivated = "Control de crucero desactivado"
deactivated = "Control de crucero desactivado",
not_Enough_Fuel = "No hay suficiente combustible"
},
editor = {
started = "¡Grabación iniciada!",
Expand All @@ -46,7 +47,7 @@ local Translations = {
firework = {
place_progress = "Colocando fuegos artificiales...",
canceled = "Cancelado...",
time_left = "Lanzamiento de fuegos artificiales en ~r~"
time_left = "Lanzamiento de fuegos artificiales en "
},
seatbelt = {
use_harness_progress = "Colocando arnés de carrera",
Expand All @@ -57,7 +58,8 @@ local Translations = {
teleport_default = 'Usar ascensor'
},
pushcar = {
stop_push = "[E] Dejar de empujar"
stop_push = "[E] Dejar de empujar",
notDamaged = "¡El vehículo no está lo suficientemente dañado para empujar!"
}
}

Expand Down
8 changes: 5 additions & 3 deletions locales/nl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ local Translations = {
cruise = {
unavailable = "Cruisecontrol niet beschikbaar",
activated = "Cruise geactiveerd",
deactivated = "Cruise gedeactiveerd"
deactivated = "Cruise gedeactiveerd",
not_Enough_Fuel = "Niet genoeg brandstof"
},
editor = {
started = "Aan het opnemen!",
Expand All @@ -46,7 +47,7 @@ local Translations = {
firework = {
place_progress = "Vuurwerk aan het plaatsen...",
canceled = "Geannuleerd...",
time_left = "Vuurwerk over ~r~"
time_left = "Vuurwerk over "
},
seatbelt = {
use_harness_progress = "Raceharnas bevestigen",
Expand All @@ -57,7 +58,8 @@ local Translations = {
teleport_default = 'Gebruik lift'
},
pushcar = {
stop_push = "[E] Stop met duwen"
stop_push = "[E] Stop met duwen",
notDamaged = "Het voertuig is niet beschadigd genoeg om te duwen!"
}
}

Expand Down
5 changes: 3 additions & 2 deletions locales/pt-br.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ local Translations = {
cruise = {
unavailable = "Controle de cruzeiro indisponível",
activated = "Cruise Control Ativado",
deactivated = "Cruise Control Desativado"
deactivated = "Cruise Control Desativado",
not_Enough_Fuel = "Combustível insuficiente"
},
editor = {
started = "Gravação Iniciada!",
Expand All @@ -46,7 +47,7 @@ local Translations = {
firework = {
place_progress = "Soltando fogos de artifício...",
canceled = "Cancelado...",
time_left = "Fogos de artifício acabaram ~r~"
time_left = "Fogos de artifício acabaram "
},
seatbelt = {
use_harness_progress = "Prendendo o Cinto de Corrida",
Expand Down
23 changes: 23 additions & 0 deletions locales/pt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,34 @@ local Translations = {
["time_until_firework"] = "Fogo de Artifício em ~r~%{time}",
["push_vehicle"] = "[~g~SHIFT~w~] + [~g~E~w~] para empurrar veículo"
},
cruise = {
["not_Enough_Fuel"] = "Combustível insuficiente",
["activated"] = "Cruise control ativado",
["deactivated"] = "Cruise control desativado",
["unavailable"] = "Cruise control indisponível"
},
editor = {
["record"] = "Gravação Iniciada!",
["save"] = "Gravação Guardada!",
["delete_clip"] = "Gravação Apagada!",
["editor"] = "Later aligator!"
},
firework = {
["canceled"] = "Cancelado...",
["time_left"] = "Fogo de Artifício em ",
["place_firework"] = "A colocar fogo de artifício..."
},
seatbelt = {
["no_car"] = "Não estás dentro de um carro.",
["use_harness"] = "A colocar Arnês de Corrida",
["remove_harness"] = "A remover Arnês de Corrida"
},
teleport = {
["teleport_default"] = "Usar Elevador"
},
pushcar = {
["stop_push"] = "[E] Parar de Empurrar",
["notDamaged"] = "O veículo não está danificado o suficiente para empurrar!"
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/afk.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()


RegisterNetEvent('KickForAFK', function()
DropPlayer(source, Lang:t("afk.kick_message"))
Expand Down
2 changes: 1 addition & 1 deletion server/consumables.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()

----------- / alcohol

for k, _ in pairs(Config.Consumables.alcohol) do
Expand Down
2 changes: 1 addition & 1 deletion server/logs.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()


local Webhooks = {
['default'] = '',
Expand Down
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local QBCore = exports['qb-core']:GetCoreObject()


RegisterNetEvent('tackle:server:TacklePlayer', function(playerId)
TriggerClientEvent('tackle:client:GetTackled', playerId)
Expand Down