mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
add features
This commit is contained in:
+13
-21
@@ -729,31 +729,23 @@ ESX.Game.SetVehicleProperties = function(vehicle, props)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ESX.Game.Utils.DrawText3D = function(coords, text, size, font)
|
ESX.Game.Utils.DrawText3D = function(coords, text, scale, font)
|
||||||
coords = vector3(coords.x, coords.y, coords.z)
|
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||||
|
|
||||||
local camCoords = GetGameplayCamCoords()
|
if not scale then scale = 0.35 end
|
||||||
local distance = #(coords - camCoords)
|
if not font then font = 4 end
|
||||||
|
|
||||||
if not size then size = 1 end
|
SetTextScale(scale, scale)
|
||||||
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)
|
|
||||||
SetTextFont(font)
|
SetTextFont(font)
|
||||||
SetTextColour(255, 255, 255, 255)
|
SetTextProportional(1)
|
||||||
SetTextDropshadow(0, 0, 0, 0, 255)
|
SetTextColour(255, 255, 255, 215)
|
||||||
SetTextDropShadow()
|
SetTextEntry('STRING')
|
||||||
SetTextOutline()
|
|
||||||
SetTextCentre(true)
|
SetTextCentre(true)
|
||||||
|
AddTextComponentString(text)
|
||||||
SetDrawOrigin(coords, 0)
|
SetDrawOrigin(vector.xyz, 0)
|
||||||
BeginTextCommandDisplayText('STRING')
|
DrawText(0.0, 0.0)
|
||||||
AddTextComponentSubstringPlayerName(text)
|
local factor = string.len(text) / 370
|
||||||
EndTextCommandDisplayText(0.0, 0.0)
|
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
|
||||||
ClearDrawOrigin()
|
ClearDrawOrigin()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -166,10 +166,10 @@ ESX.RegisterCommand('sv_restart', "admin", function(xPlayer, args, showError)
|
|||||||
for _, playerId in ipairs(GetPlayers()) do
|
for _, playerId in ipairs(GetPlayers()) do
|
||||||
DropPlayer(playerId, "Server Restart")
|
DropPlayer(playerId, "Server Restart")
|
||||||
end
|
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
|
crash = true
|
||||||
while crash do
|
while crash do
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
|||||||
@@ -513,6 +513,15 @@ ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
|
|||||||
cb(players)
|
cb(players)
|
||||||
end)
|
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
|
-- version check
|
||||||
Citizen.CreateThread(
|
Citizen.CreateThread(
|
||||||
function()
|
function()
|
||||||
|
|||||||
Reference in New Issue
Block a user