init
This commit is contained in:
commit
de97c02393
60
client/client.lua
Normal file
60
client/client.lua
Normal file
@ -0,0 +1,60 @@
|
||||
local marker = nil
|
||||
local markerCoords = nil
|
||||
local distanceText = nil
|
||||
|
||||
function CreateMarker(coords)
|
||||
if DoesBlipExist(marker) then
|
||||
RemoveBlip(marker)
|
||||
end
|
||||
marker = AddBlipForCoord(coords.x, coords.y, coords.z)
|
||||
SetBlipSprite(marker, 1)
|
||||
SetBlipDisplay(marker, 2)
|
||||
SetBlipColour(marker, 2)
|
||||
SetBlipAsShortRange(marker, true)
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString("Marker")
|
||||
EndTextCommandSetBlipName(marker)
|
||||
CreateThread(function()
|
||||
while DoesBlipExist(marker) do
|
||||
Wait(0)
|
||||
DisplayDistance()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function MeasureDistance()
|
||||
local playerPed = PlayerPedId()
|
||||
local playerCoords = GetEntityCoords(playerPed)
|
||||
local distance = GetDistanceBetweenCoords(playerCoords, markerCoords.x, markerCoords.y, markerCoords.z, true)
|
||||
return distance
|
||||
end
|
||||
|
||||
function DisplayDistance()
|
||||
local distance = MeasureDistance()
|
||||
SetTextFont(0)
|
||||
SetTextScale(0.5, 0.5)
|
||||
SetTextColour(255, 255, 255, 255)
|
||||
SetTextOutline()
|
||||
SetTextEntry("STRING")
|
||||
AddTextComponentString("Distance to marker: " .. distance)
|
||||
DrawText(0.2, 0.8)
|
||||
end
|
||||
|
||||
function RemoveStuff()
|
||||
function RemoveStuff()
|
||||
if DoesBlipExist(marker) then
|
||||
RemoveBlip(marker)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RegisterCommand(Config.Place, function()
|
||||
local playerPed = PlayerPedId()
|
||||
local playerCoords = GetEntityCoords(playerPed)
|
||||
markerCoords = playerCoords
|
||||
CreateMarker(markerCoords)
|
||||
end)
|
||||
|
||||
RegisterCommand(Config.Remove, function()
|
||||
RemoveStuff()
|
||||
end)
|
5
config.lua
Normal file
5
config.lua
Normal file
@ -0,0 +1,5 @@
|
||||
Config = {}
|
||||
|
||||
Config.Place = 'placemarker' --Command to place marker
|
||||
Config.Remove = 'removemarker' --Command to remove marker
|
||||
|
14
fxmanifest.lua
Normal file
14
fxmanifest.lua
Normal file
@ -0,0 +1,14 @@
|
||||
Description 'ngd-ruler | Nemesis Gaming Development'
|
||||
author 'deluce#9077'
|
||||
fx_version 'cerulean'
|
||||
game 'gta5'
|
||||
|
||||
shared_scripts {
|
||||
"config.lua",
|
||||
}
|
||||
|
||||
client_scripts {
|
||||
'client/*.lua',
|
||||
}
|
||||
|
||||
lua54 'yes'
|
13
readme.md
Normal file
13
readme.md
Normal file
@ -0,0 +1,13 @@
|
||||
# ngd-ruler
|
||||
|
||||

|
||||
|
||||
|
||||
**ngd-ruler** is a simple developer tool that uses puts a marker on the map and measures the distance between it and the player.
|
||||
|
||||
www.nemesisgd.com
|
||||
|
||||
https://discord.gg/AnXx2GVGcM
|
||||
|
||||

|
||||
|
Loading…
Reference in New Issue
Block a user