1
0
Fork 0
forked from Simnation/Main
Main/resources/[test]/Duck_Alk.test/client.lua

40 lines
1 KiB
Lua
Raw Permalink Normal View History

2025-06-07 08:51:21 +02:00
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)