Skip to content

Commit 8835d95

Browse files
committed
Update v1.7.1
* Added Command to show Coords
1 parent 2f2a9b5 commit 8835d95

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

client_showCoords.lua

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
local showCoords = false
2+
3+
RegisterNetEvent('msk_core:showCoords', function()
4+
showCoords = not showCoords
5+
end)
6+
7+
local DrawGenericText = function(text)
8+
SetTextColour(186, 186, 186, 255)
9+
SetTextFont(7)
10+
SetTextScale(0.378, 0.378)
11+
SetTextWrap(0.0, 1.0)
12+
SetTextCentre(false)
13+
SetTextDropshadow(0, 0, 0, 0, 255)
14+
SetTextEdge(1, 0, 0, 0, 205)
15+
SetTextEntry("STRING")
16+
AddTextComponentString(text)
17+
DrawText(0.40, 0.00)
18+
end
19+
20+
CreateThread(function()
21+
while true do
22+
local sleep = 500
23+
24+
if showCoords then
25+
sleep = 0
26+
local playerPed = PlayerPedId()
27+
local playerX, playerY, playerZ = table.unpack(GetEntityCoords(playerPed))
28+
local playerH = GetEntityHeading(playerPed)
29+
30+
DrawGenericText(("~g~X~w~ = ~r~%s ~g~Y~w~ = ~r~%s ~g~Z~w~ = ~r~%s ~g~H~w~ = ~r~%s~s~"):format(MSK.Round(playerX, 2), MSK.Round(playerY, 2), MSK.Round(playerZ, 2), MSK.Round(playerH, 2)))
31+
end
32+
33+
Wait(sleep)
34+
end
35+
end)

server_showCoords.lua

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if Config.showCoords.enable then
2+
MSK.RegisterCommand(Config.showCoords.command, Config.showCoords.groups, function(source, args, rawCommand)
3+
TriggerClientEvent('msk_core:showCoords', source)
4+
end, false --[[console]], false --[[framework]], {help = 'Show your own Coords'})
5+
end

0 commit comments

Comments
 (0)