From 6131bba7cf811aa82b6b2952529ad58ffd22d1f2 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:30:45 +0200 Subject: [PATCH] chore: ([esx]\es_extended) improve formatting --- .../[esx]/es_extended/client/main.lua | 30 +++++++++---------- .../[esx]/es_extended/server/commands.lua | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server-data/resources/[esx]/es_extended/client/main.lua b/server-data/resources/[esx]/es_extended/client/main.lua index 65e2ab55e..5c5ccb1a7 100644 --- a/server-data/resources/[esx]/es_extended/client/main.lua +++ b/server-data/resources/[esx]/es_extended/client/main.lua @@ -75,7 +75,7 @@ AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin) -- DisableVehicleRewards if Config.DisableVehicleRewards then - AddEventHandler('esx:enteredVehicle', function(vehicle, _, _, _, _) + AddEventHandler('esx:enteredVehicle', function(vehicle) if GetVehicleClass(vehicle) == 18 then CreateThread(function() while true do @@ -358,7 +358,7 @@ function StartServerSyncLoops() local sleep = 1500 if GetSelectedPedWeapon(ESX.PlayerData.ped) ~= -1569615261 then sleep = 1000 - local _,weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) + local _, weaponHash = GetCurrentPedWeapon(ESX.PlayerData.ped, true) local weapon = ESX.GetWeaponFromHash(weaponHash) if weapon then local ammoCount = GetAmmoInPedWeapon(ESX.PlayerData.ped, weaponHash) @@ -374,7 +374,7 @@ function StartServerSyncLoops() end end Wait(sleep) - end + end end) end end @@ -419,34 +419,34 @@ AddEventHandler("esx:tpm", function() local x, y, groundZ, Z_START = coords['x'], coords['y'], 850.0, 950.0 local found = false if vehicle > 0 then - FreezeEntityPosition(vehicle, true) + FreezeEntityPosition(vehicle, true) else - FreezeEntityPosition(ped, true) + FreezeEntityPosition(ped, true) end for i = Z_START, 0, -25.0 do local z = i if (i % 2) ~= 0 then - z = Z_START - i + z = Z_START - i end NewLoadSceneStart(x, y, z, x, y, z, 50.0, 0) local curTime = GetGameTimer() while IsNetworkLoadingScene() do - if GetGameTimer() - curTime > 1000 then - break - end - Wait(0) + if GetGameTimer() - curTime > 1000 then + break + end + Wait(0) end NewLoadSceneStop() SetPedCoordsKeepVehicle(ped, x, y, z) while not HasCollisionLoadedAroundEntity(ped) do - RequestCollisionAtCoord(x, y, z) - if GetGameTimer() - curTime > 1000 then - break - end - Wait(0) + RequestCollisionAtCoord(x, y, z) + if GetGameTimer() - curTime > 1000 then + break + end + Wait(0) end -- Get ground coord. As mentioned in the natives, this only works if the client is in render distance. diff --git a/server-data/resources/[esx]/es_extended/server/commands.lua b/server-data/resources/[esx]/es_extended/server/commands.lua index 7f2a051d7..4bfa1af31 100644 --- a/server-data/resources/[esx]/es_extended/server/commands.lua +++ b/server-data/resources/[esx]/es_extended/server/commands.lua @@ -308,11 +308,11 @@ ESX.RegisterCommand('saveall', 'admin', function() Core.SavePlayers() end, true, { help = _U('command_saveall') }) -ESX.RegisterCommand('group', { "user", "admin" }, function(xPlayer, _, _) +ESX.RegisterCommand('group', { "user", "admin" }, function(xPlayer) print(('%s, you are currently: ^5%s^0'):format(xPlayer.getName(), xPlayer.getGroup())) end, true) -ESX.RegisterCommand('job', { "user", "admin" }, function(xPlayer, _, _) +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)