Skip to content

Commit

Permalink
Merge pull request esx-framework#1228 from esx-framework/dev
Browse files Browse the repository at this point in the history
♻️ Synch main to dev
  • Loading branch information
Gellipapa authored Sep 24, 2023
2 parents 3006101 + f904136 commit bcc1e87
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 170 deletions.
20 changes: 10 additions & 10 deletions [core]/es_extended/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ function ESX.Game.GetVehicleProperties(vehicle)
local doorsBroken, windowsBroken, tyreBurst = {}, {}, {}
local numWheels = tostring(GetVehicleNumberOfWheels(vehicle))

local TyresIndex = { -- Wheel index list according to the number of vehicle wheels.
['2'] = { 0, 4 }, -- Bike and cycle.
['3'] = { 0, 1, 4, 5 }, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
['4'] = { 0, 1, 4, 5 }, -- Vehicle with 4 wheels.
local TyresIndex = { -- Wheel index list according to the number of vehicle wheels.
['2'] = { 0, 4 }, -- Bike and cycle.
['3'] = { 0, 1, 4, 5 }, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
['4'] = { 0, 1, 4, 5 }, -- Vehicle with 4 wheels.
['6'] = { 0, 1, 2, 3, 4, 5 } -- Vehicle with 6 wheels.
}

Expand Down Expand Up @@ -1077,8 +1077,8 @@ function ESX.ShowInventory()

elements[1].title = TranslateCap('inventory', currentWeight, Config.MaxWeight)

for i=1, #Config.Weapons do
local v = Config.Weapons[i]
for i = 1, #Config.Weapons do
local v = Config.Weapons[i]
local weaponHash = joaat(v.name)

if HasPedGotWeapon(playerPed, weaponHash, false) then
Expand All @@ -1097,8 +1097,8 @@ function ESX.ShowInventory()
canRemove = true
}
end
end
end

ESX.CloseContext()

ESX.OpenContext("right", elements, function(_, element)
Expand Down Expand Up @@ -1324,7 +1324,7 @@ AddEventHandler('onResourceStop', function(resourceName)
end
end
end)
-- Credits to txAdmin for the list.
-- Credits to txAdmin for the list.
local mismatchedTypes = {
[`airtug`] = "automobile", -- trailer
[`avisa`] = "submarine", -- boat
Expand Down Expand Up @@ -1365,7 +1365,7 @@ local mismatchedTypes = {
---@return string
function ESX.GetVehicleType(model)
model = type(model) == 'string' and joaat(model) or model
if not IsModelInCdimage(model) then return end
if not IsModelInCdimage(model) then return end
if mismatchedTypes[model] then
return mismatchedTypes[model]
end
Expand Down
10 changes: 5 additions & 5 deletions [core]/es_extended/locales/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ Locales["de"] = {
['command_setjob_invalid'] = 'Der Job Grad oder beides sind ungültig',
['command_setgroup'] = 'Setzt eine Berechtigungs Gruppe für einen User',
['command_setgroup_group'] = 'Name der Gruppe',
['command_removeaccountmoney'] = 'Entfernt Geld von einem bestimmten Account',
['command_removeaccountmoney_account'] = 'Account von wem es entfernt werden soll',
['command_removeaccountmoney_amount'] = 'Anzahl die Entfernt werden soll',
['command_removeaccountmoney_invalid'] = 'Name des Accounts Ungültig',
['command_removeaccountmoney'] = 'Entfernt Geld von einem bestimmten Account',
['command_removeaccountmoney_account'] = 'Account von wem es entfernt werden soll',
['command_removeaccountmoney_amount'] = 'Anzahl die Entfernt werden soll',
['command_removeaccountmoney_invalid'] = 'Name des Accounts Ungültig',
['commanderror_argumentmismatch'] = 'Ungültiger Argument (gegeben %s, gewollt %s)',
['commanderror_argumentmismatch_number'] = 'Ungültiges Argument #%s daten typ (string gegeben, gewollte nummer)',
['commanderror_argumentmismatch_string'] = 'Invalid Argument #%s data type (passed number, wanted string)',
Expand Down Expand Up @@ -233,7 +233,7 @@ Locales["de"] = {
["weapon_tactilerifle"] = "Service Karabiner",

-- Drug Wars DLC
['weapon_candycane'] = 'Zuckerstange',
['weapon_candycane'] = 'Zuckerstange',
['weapon_acidpackage'] = 'Säure Paket',
['weapon_pistolxm3'] = 'WM 29 Pistole',
['weapon_railgunxm3'] = 'Railgun',
Expand Down
184 changes: 92 additions & 92 deletions [core]/es_extended/locales/el.lua

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions [core]/es_extended/locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ Locales["en"] = {
["weapon_precisionrifle"] = "Precision Rifle",
["weapon_tactilerifle"] = "Service Carbine",

-- Drug wars dlc
-- Drug wars dlc
["weapon_candycane"] = "Candycane",
["weapon_acidpackage"] = "Acid Package",
["weapon_pistolxm3"] = "Pistol8 x3m",
["weapon_railgunxm3"] = "Railgun",
["weapon_pistolxm3"] = "Pistol8 x3m",
["weapon_railgunxm3"] = "Railgun",

-- Thrown
["weapon_ball"] = "Baseball",
["weapon_bzgas"] = "BZ Gas",
Expand Down
4 changes: 2 additions & 2 deletions [core]/es_extended/locales/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ Locales["fr"] = {
["weapon_precisionrifle"] = "Fusil de précision",
["weapon_tactilerifle"] = "Carabine tactique",

-- Drug wars dlc
-- Drug wars dlc
["weapon_candycane"] = "Sucre d'orge",
["weapon_acidpackage"] = "Paquet d'acide",
["weapon_pistolxm3"] = "Pistolet 8 x3m",
["weapon_pistolxm3"] = "Pistolet 8 x3m",
["weapon_railgunxm3"] = "Fusil électro-magnétique",

-- Thrown
Expand Down
18 changes: 9 additions & 9 deletions [core]/es_extended/locales/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ Locales["it"] = {
['command_giveaccountmoney_account'] = 'Account a cui aggiungere',
['command_giveaccountmoney_amount'] = 'Quantità da aggiungere',
['command_giveaccountmoney_invalid'] = 'Nome account non valido',
['command_removeaccountmoney'] = 'Rimuovi soldi da un account specifico',
['command_removeaccountmoney_account'] = 'Account a cui togliere',
['command_removeaccountmoney_amount'] = 'Quantità da rimuovere',
['command_removeaccountmoney_invalid'] = 'Nome account non valido',
['command_removeaccountmoney'] = 'Rimuovi soldi da un account specifico',
['command_removeaccountmoney_account'] = 'Account a cui togliere',
['command_removeaccountmoney_amount'] = 'Quantità da rimuovere',
['command_removeaccountmoney_invalid'] = 'Nome account non valido',
['command_giveitem'] = 'Dai un oggetto ad un giocatore',
['command_giveitem_item'] = 'Nome oggetto',
['command_giveitem_count'] = 'Quantità',
Expand Down Expand Up @@ -208,7 +208,7 @@ Locales["it"] = {
["weapon_militaryrifle"] = "Fucile militare",
["weapon_specialcarbine"] = "Carabina speciale",
["weapon_specialcarbine_mk2"] = "Carabina speciale MK2",
["weapon_heavyrifle"] = "Fucile pesante",
["weapon_heavyrifle"] = "Fucile pesante",

-- Sniper
["weapon_heavysniper"] = "Cecchino pesante",
Expand All @@ -233,10 +233,10 @@ Locales["it"] = {
["weapon_tactilerifle"] = "Carabina di servizio",

-- Drug Wars DLC
['weapon_candycane'] = 'Bastoncino di zucchero',
['weapon_acidpackage'] = 'Pacco di acidi',
['weapon_pistolxm3'] = 'Pistola WM 29',
['weapon_railgunxm3'] = 'Railgun',
['weapon_candycane'] = 'Bastoncino di zucchero',
['weapon_acidpackage'] = 'Pacco di acidi',
['weapon_pistolxm3'] = 'Pistola WM 29',
['weapon_railgunxm3'] = 'Railgun',

-- Thrown
["weapon_ball"] = "Palla",
Expand Down
8 changes: 4 additions & 4 deletions [core]/es_extended/locales/nl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Locales["nl"] = {
["bank"] = "Maze Bank",
["account_bank"] = "Bank",
["account_black_money"] = "Zwart geld",
["account_money"] = "Contant",
["account_money"] = "Contant",

["act_imp"] = "Kan actie niet uitvoeren",
["in_vehicle"] = "Kan actie niet uitvoeren, de speler zit in een voertuig.",
Expand Down Expand Up @@ -226,8 +226,8 @@ Locales["nl"] = {
-- Drug Wars DLC
["weapon_candycane"] = "Snoep stok",
["weapon_acidpackage"] = "LSD pakket",
["weapon_pistolxm3"] = "WM 29 Pistool",
["weapon_railgunxm3"] = "Railgun",
["weapon_pistolxm3"] = "WM 29 Pistool",
["weapon_railgunxm3"] = "Railgun",

-- Thrown
["weapon_ball"] = "Honkbal",
Expand Down Expand Up @@ -369,4 +369,4 @@ Locales["nl"] = {
["tint_lspd"] = "blauwe skin",
["tint_orange"] = "oranje skin",
["tint_platinum"] = "platina skin",
}
}
12 changes: 6 additions & 6 deletions [core]/es_extended/server/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,21 @@ end, true)
ESX.RegisterCommand('job', { "user", "admin" }, function(xPlayer, _, _)
print(('%s, your job is: ^5%s^0 - ^5%s^0'):format(xPlayer.getName(), xPlayer.getJob().name,
xPlayer.getJob().grade_label))
end, true)
end, false)

ESX.RegisterCommand('info', { "user", "admin" }, function(xPlayer)
local job = xPlayer.getJob().name
print(('^2ID: ^5%s^0 | ^2Name: ^5%s^0 | ^2Group: ^5%s^0 | ^2Job: ^5%s^0'):format(xPlayer.source, xPlayer.getName(),
xPlayer.getGroup(), job))
end, true)
end, false)

ESX.RegisterCommand('coords', "admin", function(xPlayer)
local ped = GetPlayerPed(xPlayer.source)
local coords = GetEntityCoords(ped, false)
local heading = GetEntityHeading(ped)
print(('Coords - Vector3: ^5%s^0'):format(vector3(coords.x, coords.y, coords.z)))
print(('Coords - Vector4: ^5%s^0'):format(vector4(coords.x, coords.y, coords.z, heading)))
end, true)
end, false)

ESX.RegisterCommand('tpm', "admin", function(xPlayer)
xPlayer.triggerEvent("esx:tpm")
Expand All @@ -471,7 +471,7 @@ ESX.RegisterCommand('tpm', "admin", function(xPlayer)
{ name = "ID", value = xPlayer and xPlayer.source or "Unknown ID", inline = true },
})
end
end, true)
end, false)

ESX.RegisterCommand('goto', "admin", function(xPlayer, args)
local targetCoords = args.playerId.getCoords()
Expand All @@ -484,7 +484,7 @@ ESX.RegisterCommand('goto', "admin", function(xPlayer, args)
{ name = "Target Coords", value = targetCoords, inline = true },
})
end
end, true, {
end, false, {
help = TranslateCap('command_goto'),
validate = true,
arguments = {
Expand All @@ -504,7 +504,7 @@ ESX.RegisterCommand('bring', "admin", function(xPlayer, args)
{ name = "Target Coords", value = targetCoords, inline = true },
})
end
end, true, {
end, false, {
help = TranslateCap('command_bring'),
validate = true,
arguments = {
Expand Down
76 changes: 38 additions & 38 deletions [core]/es_extended/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,12 @@ function loadESXPlayer(identifier, playerId, isNew)
xPlayer.set('height', userData.height)
end
end
--saved player health and armor in metadata
local ped = GetPlayerPed(xPlayer.source)
if ped then
xPlayer.setMeta('health', xPlayer.getMeta('health') or GetEntityHealth(ped))
xPlayer.setMeta('armor', xPlayer.getMeta('armor') or GetPedArmour(ped))
end
--saved player health and armor in metadata
local ped = GetPlayerPed(xPlayer.source)
if ped then
xPlayer.setMeta('health', xPlayer.getMeta('health') or GetEntityHealth(ped))
xPlayer.setMeta('armor', xPlayer.getMeta('armor') or GetPedArmour(ped))
end

TriggerEvent('esx:playerLoaded', playerId, xPlayer, isNew)

Expand Down Expand Up @@ -386,9 +386,9 @@ AddEventHandler('playerDropped', function(reason)

if xPlayer then
TriggerEvent('esx:playerDropped', playerId, reason)
local job = xPlayer.getJob().name
local job = xPlayer.getJob().name
local currentJob = ESX.JobsPlayerCount[job]
ESX.JobsPlayerCount[job] = ((currentJob and currentJob > 0) and currentJob or 1) -1
ESX.JobsPlayerCount[job] = ((currentJob and currentJob > 0) and currentJob or 1) - 1
GlobalState[("%s:count"):format(job)] = ESX.JobsPlayerCount[job]
Core.playersByIdentifier[xPlayer.identifier] = nil
Core.SavePlayer(xPlayer, function()
Expand All @@ -397,21 +397,21 @@ AddEventHandler('playerDropped', function(reason)
end
end)

AddEventHandler("esx:playerLoaded", function(playerId, xPlayer, isNew)
local job = xPlayer.getJob().name
AddEventHandler("esx:playerLoaded", function(_, xPlayer)
local job = xPlayer.getJob().name
local jobKey = ("%s:count"):format(job)
ESX.JobsPlayerCount[job] = (ESX.JobsPlayerCount[job] or 0) +1

ESX.JobsPlayerCount[job] = (ESX.JobsPlayerCount[job] or 0) + 1
GlobalState[jobKey] = ESX.JobsPlayerCount[job]
end)

AddEventHandler("esx:setJob", function(src, job, lastJob)
AddEventHandler("esx:setJob", function(_, job, lastJob)
local lastJobKey = ('%s:count'):format(lastJob.name)
local jobKey = ('%s:count'):format(job.name)
local currentLastJob = ESX.JobsPlayerCount[lastJob.name]

ESX.JobsPlayerCount[lastJob.name] = ((currentLastJob and currentLastJob > 0) and currentLastJob or 1) -1
ESX.JobsPlayerCount[job.name] = (ESX.JobsPlayerCount[job.name] or 0) + 1
ESX.JobsPlayerCount[lastJob.name] = ((currentLastJob and currentLastJob > 0) and currentLastJob or 1) - 1
ESX.JobsPlayerCount[job.name] = (ESX.JobsPlayerCount[job.name] or 0) + 1

GlobalState[lastJobKey] = ESX.JobsPlayerCount[lastJob.name]
GlobalState[jobKey] = ESX.JobsPlayerCount[job.name]
Expand Down Expand Up @@ -616,11 +616,11 @@ if not Config.OxInventory then
local pickup, xPlayer, success = Core.Pickups[pickupId], ESX.GetPlayerFromId(source)

if pickup then
local playerPickupDistance = #(pickup.coords - xPlayer.getCoords(true))
if(playerPickupDistance > 5.0) then
print(('[^3WARNING^7] Player Detected Cheating (Out of range pickup): ^5%s^7'):format(xPlayer.getIdentifier()))
return
end
local playerPickupDistance = #(pickup.coords - xPlayer.getCoords(true))
if (playerPickupDistance > 5.0) then
print(('[^3WARNING^7] Player Detected Cheating (Out of range pickup): ^5%s^7'):format(xPlayer.getIdentifier()))
return
end

if pickup.type == 'item_standard' then
if xPlayer.canCarryItem(pickup.name, pickup.count) then
Expand Down Expand Up @@ -738,30 +738,30 @@ AddEventHandler('txAdmin:events:serverShuttingDown', function()
end)

local DoNotUse = {
['essentialmode'] = true,
['es_admin2'] = true,
['basic-gamemode'] = true,
['mapmanager'] = true,
['fivem-map-skater'] = true,
['fivem-map-hipster'] = true,
['qb-core'] = true,
['default_spawnpoint'] = true,
['essentialmode'] = true,
['es_admin2'] = true,
['basic-gamemode'] = true,
['mapmanager'] = true,
['fivem-map-skater'] = true,
['fivem-map-hipster'] = true,
['qb-core'] = true,
['default_spawnpoint'] = true,
}

AddEventHandler('onResourceStart', function(key)
if DoNotUse[string.lower(key)] then
while GetResourceState(key) ~= 'started' do
Wait(0)
end
if DoNotUse[string.lower(key)] then
while GetResourceState(key) ~= 'started' do
Wait(0)
end

StopResource(key)
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
end
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
end
end)

for key in pairs(DoNotUse) do
if GetResourceState(key) == 'started' or GetResourceState(key) == 'starting' then
if GetResourceState(key) == 'started' or GetResourceState(key) == 'starting' then
StopResource(key)
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
end
print(("[^1ERROR^7] WE STOPPED A RESOURCE THAT WILL BREAK ^1ESX^7, PLEASE REMOVE ^5%s^7"):format(key))
end
end

0 comments on commit bcc1e87

Please sign in to comment.