This commit is contained in:
Max 2025-06-12 22:22:51 +02:00
parent 81e52e0c91
commit 6e9b53739d

View file

@ -1,3 +1,6 @@
QBCore = nil
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
local function DiscordNachricht()
if Config.DiscordWebhook == "" then return end
@ -8,9 +11,9 @@ end
RegisterCommand('wartung', function(source)
local src = source
local spieler = QBCore.Functions.GetPlayer(src)
local Player = QBCore.Functions.GetPlayer(src)
if not QBCore.Functions.HasPermission(src, Config.ErlaubteRolle) then
if not Player or not QBCore.Functions.HasPermission(src, Config.ErlaubteRolle) then
TriggerClientEvent('QBCore:Notify', src, 'Keine Berechtigung!', 'error')
return
end
@ -20,7 +23,7 @@ RegisterCommand('wartung', function(source)
TriggerClientEvent('QBCore:Notify', v, 'Wartungsarbeiten beginnen!', 'error')
end
DiscordNachricht()
TriggerClientEvent('QBCore:Notify', src, 'Wartung angekündigt!', 'success')