Skip to content

Commit ce3ba9a

Browse files
committed
fix(menu): disable weapon firing during noclip (#1061)
1 parent 35e173a commit ce3ba9a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

resource/menu/vendor/freecam/main.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function StartFreecamThread()
9090
-- Camera/Pos updating thread
9191
Citizen.CreateThread(function()
9292
local ped = PlayerPedId()
93+
local playerId = PlayerId()
9394
local initialPos = GetEntityCoords(ped)
9495
SetFreecamPosition(initialPos[1], initialPos[2], initialPos[3])
9596
local veh = GetVehiclePedIsIn(ped, false)
@@ -113,6 +114,9 @@ function StartFreecamThread()
113114
local frameCounter = 0
114115
local loopPos, loopRotZ
115116
while IsFreecamActive() do
117+
-- Disable weapon firing while in noclip (fixes #1061)
118+
DisablePlayerFiring(playerId, true)
119+
116120
loopPos, loopRotZ = UpdateCamera()
117121
frameCounter = frameCounter + 1
118122
if frameCounter > 100 then

0 commit comments

Comments
 (0)