Skip to content

Commit abfd735

Browse files
authored
Merge pull request #24 from NotLazy/master
Minor Improvements
2 parents e536682 + 744074b commit abfd735

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

cl.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ nearest = nil
2020
pBlip = nil
2121

2222
exports('getPostal', function() return nearest and nearest.code or nil end)
23+
exports('getDistance', function() return nearest and nearest.dist or nil end)
24+
exports('getNearest', function() return nearest end)

cl_render.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Citizen.CreateThread(function()
2222
while postals == nil do Wait(1) end
2323

2424
local delay = math.max(config.updateDelay and tonumber(config.updateDelay) or 300, 50)
25-
if not delay or tonumber(delay) <= 0 then
26-
error("Invalid render delay provided, it must be a number > 0")
25+
if not delay or tonumber(delay) < 50 then
26+
error("Invalid render delay provided, it must be a number > 50")
2727
end
2828

2929
local postals = postals
@@ -65,6 +65,9 @@ end)
6565

6666
-- text display thread
6767
Citizen.CreateThread(function()
68+
if config.text.display == false then
69+
return
70+
end
6871
local posX = config.text.posX
6972
local posY = config.text.posY
7073
local _string = "STRING"

config.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ config = {
33
versionCheck = true,
44

55
text = {
6+
-- Turn on or off the text display
7+
display = true,
68
-- The text to display on-screen for the nearest postal.
79
-- Formatted using Lua strings, http://www.lua.org/pil/20.html
810
format = '~y~Nearest Postal~w~: %s (~g~%.2fm~w~)',
@@ -44,6 +46,7 @@ config = {
4446
},
4547

4648
-- How often in milliseconds the postal code is updated on each client.
47-
-- I wouldn't recommend anything lower than 50ms for performance reasons
49+
-- Default: 300
50+
-- Minimum: 50
4851
updateDelay = nil,
4952
}

0 commit comments

Comments
 (0)