forked from Simnation/Main
ed
This commit is contained in:
parent
8f5115d602
commit
860d27e06f
17 changed files with 960 additions and 0 deletions
22
resources/[tools]/nearest-postal-1.5.3/cl.lua
Normal file
22
resources/[tools]/nearest-postal-1.5.3/cl.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
---@class PostalData : table<number, vec>
|
||||
---@field code string
|
||||
---@type table<number, PostalData>
|
||||
postals = nil
|
||||
Citizen.CreateThread(function()
|
||||
postals = LoadResourceFile(GetCurrentResourceName(), GetResourceMetadata(GetCurrentResourceName(), 'postal_file'))
|
||||
postals = json.decode(postals)
|
||||
for i, postal in ipairs(postals) do postals[i] = { vec(postal.x, postal.y), code = postal.code } end
|
||||
end)
|
||||
|
||||
---@class NearestResult
|
||||
---@field code string
|
||||
---@field dist number
|
||||
nearest = nil
|
||||
|
||||
---@class PostalBlip
|
||||
---@field 1 vec
|
||||
---@field p PostalData
|
||||
---@field hndl number
|
||||
pBlip = nil
|
||||
|
||||
exports('getPostal', function() return nearest and nearest.code or nil end)
|
Loading…
Add table
Add a link
Reference in a new issue