39 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
RegisterNetEvent('alk:showResult', function(targetName, value)
 | 
						|
    local msg = ("Alkoholtest bei %s: %.2f"):format(targetName, value)
 | 
						|
    lib.notify({
 | 
						|
        title = 'Alkoholtester',
 | 
						|
        description = msg,
 | 
						|
        type = 'inform',
 | 
						|
        duration = 10000
 | 
						|
    })
 | 
						|
end)
 | 
						|
 | 
						|
--# Benachrichtigung der getesteten ID & trunk mode #--
 | 
						|
RegisterNetEvent('alk:notifyTarget', function(value, duration)
 | 
						|
    local msg = ("Zu wenig, sauf weiter. Ergebnis: %.2f"):format(value)
 | 
						|
    lib.notify({
 | 
						|
        title = 'Alkoholtest',
 | 
						|
        description = msg,
 | 
						|
        type = 'info',
 | 
						|
        duration = 8000
 | 
						|
    })
 | 
						|
 | 
						|
    
 | 
						|
    if value >= 0.5 then
 | 
						|
        DoScreenFadeOut(1000)
 | 
						|
        Wait(1000)
 | 
						|
        DoScreenFadeIn(1000)
 | 
						|
 | 
						|
        
 | 
						|
        StartGameplayCamShake("DRUNK_SHAKE", 1.0)
 | 
						|
       
 | 
						|
        StartScreenEffect("DrugsMichaelAliensFightIn", 0, true)
 | 
						|
 | 
						|
        local timer = (duration or 30) * 1000
 | 
						|
        Wait(timer)
 | 
						|
 | 
						|
       
 | 
						|
        StopScreenEffect("DrugsMichaelAliensFightIn")
 | 
						|
        StopGameplayCamShaking(true)
 | 
						|
    end
 | 
						|
end)
 |