Skip to content

Commit 5be0e93

Browse files
committed
Update v1.2
Added MSK.Draw3DText
1 parent 6cf44dc commit 5be0e93

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1
1+
1.2

client.lua

+24-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ MSK.HelpNotification = function(text)
2828
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
2929
end
3030

31+
MSK.Draw3DText = function(coords, text, size, font)
32+
local coords = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
33+
local camCoords = GetGameplayCamCoords()
34+
local distance = #(coords - camCoords)
35+
36+
if not size then size = 1 end
37+
if not font then font = 0 end
38+
39+
local scale = (size / distance) * 2
40+
local fov = (1 / GetGameplayCamFov()) * 100
41+
scale = scale * fov
42+
43+
SetTextScale(0.0, scale * 0.5)
44+
SetTextFont(font)
45+
SetTextProportional(1)
46+
SetTextColour(255, 255, 255, 255)
47+
BeginTextCommandDisplayText('STRING')
48+
SetTextCentre(true)
49+
AddTextComponentSubstringPlayerName(text)
50+
SetDrawOrigin(coords.xyz, 0)
51+
EndTextCommandDisplayText(0.0, 0.0)
52+
ClearDrawOrigin()
53+
end
54+
3155
MSK.Table_Contains = function(table, value)
3256
if type(value) == 'table' then
3357
for k, v in pairs(table) do
@@ -115,11 +139,6 @@ AddEventHandler("msk_core:notification", function(text)
115139
MSK.Notification(text)
116140
end)
117141

118-
RegisterNetEvent("msk_core:helpNotification")
119-
AddEventHandler("msk_core:helpNotification", function(text)
120-
MSK.HelpNotification(text)
121-
end)
122-
123142
CreateThread(function()
124143
while true do
125144
local sleep = 100

fxmanifest.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_core'
66
description 'Core functions for MSK Scripts'
7-
version '1.1'
7+
version '1.2'
88

99
lua54 'yes'
1010

server.lua

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ MSK.Notification = function(src, text)
1919
TriggerClientEvent('msk_core:notification', src, text)
2020
end
2121

22-
MSK.HelpNotification = function(src, text)
23-
TriggerClientEvent('msk_core:helpNotification', src, text)
24-
end
25-
2622
MSK.Table_Contains = function(table, value)
2723
if type(value) == 'table' then
2824
for k, v in pairs(table) do

0 commit comments

Comments
 (0)