Accessible Code
Shared = {
Locale = 'en',
Notify = {
duration = 5000, -- miliseconds
position = 'top-right' -- 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left'
},
TextUI = {
position = 'right-center' -- 'right-center' or 'left-center' or 'top-center' or 'bottom-center'
},
Logs = {
enabled = true,
webhook = '',
servername = 'Uniq Scripts',
color = 6579450,
icon_url = 'https://dunb17ur4ymx4.cloudfront.net/webstore/logos/046c8efd198a2806b6ae46490f6aa780a225125e.png'
},
Commands = {
addparcel = {
name = 'addparcel', -- command for adding parcel
restricted = 'group.admin', -- group that will have acces to command
}
},
Blip = {
Label = "Post Office",
ID = 478,
Scale = 1.0,
Colour = 47
},
PlateLetters = 3,
PlateNumbers = 3,
PlateUseSpace = true,
Target = true,
Ped = {
model = 's_m_m_postal_02', -- https://docs.fivem.net/docs/game-references/ped-models/
coords = vector4(133.1209, 96.64616, 83.50256, 150)
},
}
-- Framework
QBCore = exports['qb-core']:GetCoreObject()
function sendNotify(title, description, type)
lib.notify({
title = title,
description = description,
duration = Shared.Notify.duration,
type = type,
position = Shared.Notify.position
})
end
RegisterNetEvent('uniq-postoffice:notify', sendNotify)
-- Text UI
function textUI(description, icon)
lib.showTextUI(description, {
position = Shared.TextUI.position,
icon = icon
})
end
function hideTextUI()
lib.hideTextUI()
end
-- Discord Logs
local webhook = Shared.Logs.webhook
function logger(message)
if Shared.Logs.enabled then
if webhook ~= '' then
PerformHttpRequest(webhook, function(status) end, 'POST', json.encode({
username = cache.resource,
embeds = {{
color = Shared.Logs.color,
title = Shared.Logs.servername,
description = message,
footer = {
text = os.date(),
icon_url = Shared.Logs.icon_url
}
}}
}), { ['Content-Type'] = 'application/json' })
end
end
end
Locales['en'] = {
target = 'Check Post Office',
text_ui = {
help = 'Press [E] to check post office'
},
commands = {
addparcel = 'Add parcel to the player',
},
notify = {
input_all = 'You must input all the arguments required',
target_invalid = 'The target ID you entered is not on the server'
}
}
Last updated