Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better integration #8

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ local soundLoop = false

--Apprarently used by R* when drunk, makes car radio inaudible & adds reverb to everything
local function soundModeLoop()
if not config.useDrunkSoundMode then return end

soundLoop = true
CreateThread(function()
while soundLoop and alcoholLevel > 0 do
Expand Down Expand Up @@ -51,6 +53,11 @@ local function drunkLoop()

if severity then
drunkEffect(severity)
if not soundLoop and severity.toggleDrunkSounds then
soundModeLoop()
elseif soundLoop and not severity.toggleDrunkSounds then
soundLoop = false
end
end

Wait(60000 * sharedConfig.alcoholDecayTime)
Expand Down Expand Up @@ -121,9 +128,7 @@ AddStateBagChangeHandler('alcohol', ('player:%s'):format(cache.serverId), functi
end
alcoholLevel = value

if not soundLoop then
soundModeLoop()
elseif alcoholLevel <= 0 then
if alcoholLevel <= 0 then
soundLoop = false
end
end)
Expand Down
3 changes: 3 additions & 0 deletions config/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ return {
[2.0] = {
timecycle = 'Drunk',
shake = 0.75,
toggleDrunkSounds = true,
walk = 'move_m@drunk@moderatedrunk'
},
[3.0] = {
timecycle = 'spectator5',
shake = 1.25,
toggleDrunkSounds = true,
walk = 'move_m@drunk@a'
},
[4.0] = {
timecycle = 'spectator5',
shake = 2.0,
toggleDrunkSounds = true,
walk = 'MOVE_M@DRUNK@VERYDRUNK'
},
},
Expand Down
Loading