This repository has been archived on 2025-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
2025-03-17 13:54:06 +01:00

16 lines
583 B
Lua

local Config = require "config.config"
local postal = lib.load(Config.PostalFilePath)
RegisterNetEvent("melons_postals:client:SetWaypoint", function(selectedPostal)
local userPostal = string.upper(selectedPostal)
local setPostal = postal.Postals[userPostal]
if not setPostal then
utils.Notify(locale("not_found"):format(userPostal), "error")
else
if IsWaypointActive() then
DeleteWaypoint()
end
SetNewWaypoint(setPostal.x, setPostal.y)
utils.Notify(locale("set_success"):format(userPostal), "success")
end
end)