Skip to content

Commit

Permalink
chore: ([esx]\es_extended) improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Oct 7, 2023
1 parent 6f0d97f commit 6131bba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions server-data/resources/[esx]/es_extended/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -374,7 +374,7 @@ function StartServerSyncLoops()
end
end
Wait(sleep)
end
end
end)
end
end
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions server-data/resources/[esx]/es_extended/server/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6131bba

Please sign in to comment.