forked from Simnation/Main
Update
This commit is contained in:
parent
6e9b53739d
commit
66456adc6a
1 changed files with 21 additions and 4 deletions
|
@ -1,5 +1,11 @@
|
||||||
QBCore = nil
|
local QBCore = nil
|
||||||
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
|
|
||||||
|
CreateThread(function()
|
||||||
|
while QBCore == nil do
|
||||||
|
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
|
||||||
|
Wait(200)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local function DiscordNachricht()
|
local function DiscordNachricht()
|
||||||
if Config.DiscordWebhook == "" then return end
|
if Config.DiscordWebhook == "" then return end
|
||||||
|
@ -10,16 +16,26 @@ local function DiscordNachricht()
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterCommand('wartung', function(source)
|
RegisterCommand('wartung', function(source)
|
||||||
|
|
||||||
|
while not QBCore do
|
||||||
|
Wait(100)
|
||||||
|
end
|
||||||
|
|
||||||
local src = source
|
local src = source
|
||||||
local Player = QBCore.Functions.GetPlayer(src)
|
local Player = QBCore.Functions.GetPlayer(src)
|
||||||
|
|
||||||
if not Player or not QBCore.Functions.HasPermission(src, Config.ErlaubteRolle) then
|
if not Player then
|
||||||
|
print(("^1Error: Player not found (source: %s)^7"):format(src))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not QBCore.Functions.HasPermission(src, Config.ErlaubteRolle) then
|
||||||
TriggerClientEvent('QBCore:Notify', src, 'Keine Berechtigung!', 'error')
|
TriggerClientEvent('QBCore:Notify', src, 'Keine Berechtigung!', 'error')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
for _, v in pairs(QBCore.Functions.GetPlayers()) do
|
for k, v in pairs(QBCore.Functions.GetPlayers()) do
|
||||||
TriggerClientEvent('QBCore:Notify', v, 'Wartungsarbeiten beginnen!', 'error')
|
TriggerClientEvent('QBCore:Notify', v, 'Wartungsarbeiten beginnen!', 'error')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -27,4 +43,5 @@ RegisterCommand('wartung', function(source)
|
||||||
DiscordNachricht()
|
DiscordNachricht()
|
||||||
|
|
||||||
TriggerClientEvent('QBCore:Notify', src, 'Wartung angekündigt!', 'success')
|
TriggerClientEvent('QBCore:Notify', src, 'Wartung angekündigt!', 'success')
|
||||||
|
print(("^5[Wartung]^7 Wartung wurde von %s gestartet"):format(GetPlayerName(src)))
|
||||||
end, false)
|
end, false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue