forked from Simnation/Main
New Script
Wartungsarbeiten
This commit is contained in:
parent
f9b8f9ccad
commit
81e52e0c91
3 changed files with 40 additions and 0 deletions
27
resources/[Developer]/[Max]/Duck_new_wartung/server.lua
Normal file
27
resources/[Developer]/[Max]/Duck_new_wartung/server.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
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 spieler = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
if 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)
|
Loading…
Add table
Add a link
Reference in a new issue