1
0
Fork 0
forked from Simnation/Main
Main/resources/[Developer]/[Max]/Duck_new_wartung/server.lua
2025-06-12 22:22:51 +02:00

30 lines
958 B
Lua

QBCore = nil
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
local function DiscordNachricht()
if Config.DiscordWebhook == "" then return end
PerformHttpRequest(Config.DiscordWebhook, function() end, 'POST', json.encode({
content = Config.WartungsNachricht
}), { ['Content-Type'] = 'application/json' })
end
RegisterCommand('wartung', function(source)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player or not QBCore.Functions.HasPermission(src, Config.ErlaubteRolle) then
TriggerClientEvent('QBCore:Notify', src, 'Keine Berechtigung!', 'error')
return
end
for _, v in pairs(QBCore.Functions.GetPlayers()) do
TriggerClientEvent('QBCore:Notify', v, 'Wartungsarbeiten beginnen!', 'error')
end
DiscordNachricht()
TriggerClientEvent('QBCore:Notify', src, 'Wartung angekündigt!', 'success')
end, false)