mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 21:01:28 +00:00
add features
This commit is contained in:
+13
-21
@@ -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
|
||||
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user