add features

This commit is contained in:
Mycroft
2021-05-03 22:37:02 +01:00
parent 1f69396992
commit c8c8ffeb4d
3 changed files with 25 additions and 24 deletions
+13 -21
View File
@@ -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