refactor: less calculations

This commit is contained in:
MoskalykA
2023-07-26 04:58:55 +02:00
parent 7fa110c9b2
commit 74d7d7e6f6
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -1015,7 +1015,7 @@ function ESX.Game.Utils.DrawText3D(coords, text, size, font)
local fov = (1 / GetGameplayCamFov()) * 100
scale = scale * fov
SetTextScale(0.0 * scale, 0.55 * scale)
SetTextScale(0.0, 0.55 * scale)
SetTextFont(font)
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
+2 -1
View File
@@ -31,8 +31,9 @@ end
local function StartDBSync()
CreateThread(function()
local interval <const> = 10 * 60 * 1000
while true do
Wait(10 * 60 * 1000)
Wait(interval)
Core.SavePlayers()
end
end)
+3 -2
View File
@@ -147,6 +147,7 @@ function DeleteSkinCam()
end
CreateThread(function()
local customPI <const> = math.pi / 180.0
while true do
local sleep = 1500
@@ -164,7 +165,7 @@ CreateThread(function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local angle = heading * math.pi / 180.0
local angle = heading * customPI
local theta = {
x = math.cos(angle),
y = math.sin(angle)
@@ -182,7 +183,7 @@ CreateThread(function()
angleToLook = angleToLook + 360
end
angleToLook = angleToLook * math.pi / 180.0
angleToLook = angleToLook * customPI
local thetaToLook = {
x = math.cos(angleToLook),
y = math.sin(angleToLook)