diff --git a/client/functions.lua b/client/functions.lua index 9ac807c6..970a07ab 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -729,31 +729,23 @@ ESX.Game.SetVehicleProperties = function(vehicle, props) end end -ESX.Game.Utils.DrawText3D = function(coords, text, size, font) - coords = vector3(coords.x, coords.y, coords.z) +ESX.Game.Utils.DrawText3D = function(coords, text, scale, font) + local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) - local camCoords = GetGameplayCamCoords() - local distance = #(coords - camCoords) + if not scale then scale = 0.35 end + if not font then font = 4 end - if not size then size = 1 end - if not font then font = 0 end - - local scale = (size / distance) * 2 - local fov = (1 / GetGameplayCamFov()) * 100 - scale = scale * fov - - SetTextScale(0.0 * scale, 0.55 * scale) + SetTextScale(scale, scale) SetTextFont(font) - SetTextColour(255, 255, 255, 255) - SetTextDropshadow(0, 0, 0, 0, 255) - SetTextDropShadow() - SetTextOutline() + SetTextProportional(1) + SetTextColour(255, 255, 255, 215) + SetTextEntry('STRING') SetTextCentre(true) - - SetDrawOrigin(coords, 0) - BeginTextCommandDisplayText('STRING') - AddTextComponentSubstringPlayerName(text) - EndTextCommandDisplayText(0.0, 0.0) + AddTextComponentString(text) + SetDrawOrigin(vector.xyz, 0) + DrawText(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 diff --git a/server/commands.lua b/server/commands.lua index d7963fa8..757d7c5c 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -166,10 +166,10 @@ ESX.RegisterCommand('sv_restart', "admin", function(xPlayer, args, showError) for _, playerId in ipairs(GetPlayers()) do DropPlayer(playerId, "Server Restart") end - print('[^5es_extended^0] ^2[INFO] ^1 Server Restarting, Please Wait :)') + print('[^5es_extended^0] ^2[INFO] ^1 Server Restarting, Please Wait :)') crash = true - while crash do - end + while crash do + end end) end, true) diff --git a/server/main.lua b/server/main.lua index 5c3dff6b..3102f0e8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -513,6 +513,15 @@ ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players) cb(players) end) +AddEventHandler('txAdmin:events:scheduledRestart', function(eventData) + if eventData.secondsRemaining == 60 then + Citizen.CreateThread(function() + Citizen.Wait(50000) + ESX.SavePlayers() + end) + end +end) + -- version check Citizen.CreateThread( function()