Skip to content

Commit

Permalink
Merge pull request #87 from Mathu-lmn/master
Browse files Browse the repository at this point in the history
fix idle cam kvp
  • Loading branch information
alberttheprince authored Jan 26, 2025
2 parents 882b5b8 + a2ec35f commit bc92f15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions client/NoIdleCam.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
if not Config.NoIdleCam then return end

RegisterCommand('idlecamoff', function() -- help2 31, 167, 9
TriggerEvent('chat:addMessage', {
color = {227,8,0},
Expand All @@ -6,7 +8,7 @@ RegisterCommand('idlecamoff', function() -- help2 31, 167, 9
})
DisableIdleCamera(true)
SetPedCanPlayAmbientAnims(PlayerPedId(), false)
SetResourceKvp("idleCam", "off")
SetResourceKvpInt("idleCam", 1)
end, false)

RegisterCommand('idlecamon', function() -- help2 31, 167, 9
Expand All @@ -17,13 +19,17 @@ RegisterCommand('idlecamon', function() -- help2 31, 167, 9
})
DisableIdleCamera(false)
SetPedCanPlayAmbientAnims(PlayerPedId(), true)
SetResourceKvp("idleCam", "on")
SetResourceKvpInt("idleCam", 2)
end, false)

CreateThread(function()
TriggerEvent("chat:addSuggestion", "/idlecamon", "Re-enables the idle cam")
TriggerEvent("chat:addSuggestion", "/idlecamoff", "Disables the idle cam")

local idleCamDisabled = GetResourceKvpString("idleCam") == "off"
DisableIdleCamera(idleCamDisabled)
local idleCamKvp = GetResourceKvpInt("idleCam")
if idleCamKvp == 0 then
return
end

DisableIdleCamera(idleCamKvp == 1)
end)
2 changes: 2 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ Config = {
-- News Camera Options
NewscamEnabled = false, -- If set to true, the /newscam command will be enabled.

NoIdleCam = true, -- Controls wether the idle cam can be disabled by players or not

-- Preview Ped Options
PreviewPed = true, -- Shows a preview of the emote on the player's ped next to the emote menu. Note that resmon will increase when this when emotes are being previewed.

Expand Down

0 comments on commit bc92f15

Please sign in to comment.