Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
		
						commit
						e4af606e9c
					
				
					 1 changed files with 21 additions and 4 deletions
				
			
		|  | @ -1,5 +1,11 @@ | |||
| QBCore = nil | ||||
| TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end) | ||||
| local QBCore = nil | ||||
|  | ||||
| CreateThread(function() | ||||
|     while QBCore == nil do | ||||
|         TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end) | ||||
|         Wait(200) | ||||
|     end | ||||
| end) | ||||
|  | ||||
| local function DiscordNachricht() | ||||
|     if Config.DiscordWebhook == "" then return end | ||||
|  | @ -10,16 +16,26 @@ local function DiscordNachricht() | |||
| end | ||||
|  | ||||
| RegisterCommand('wartung', function(source) | ||||
|      | ||||
|     while not QBCore do | ||||
|         Wait(100) | ||||
|     end | ||||
|  | ||||
|     local src = source | ||||
|     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') | ||||
|         return | ||||
|     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') | ||||
|     end | ||||
|      | ||||
|  | @ -27,4 +43,5 @@ RegisterCommand('wartung', function(source) | |||
|     DiscordNachricht() | ||||
|      | ||||
|     TriggerClientEvent('QBCore:Notify', src, 'Wartung angekündigt!', 'success') | ||||
|     print(("^5[Wartung]^7 Wartung wurde von %s gestartet"):format(GetPlayerName(src))) | ||||
| end, false) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nordi98
						Nordi98