Skip to content

Commit

Permalink
fix: don't kick the player of the camera after taking a photo
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 committed Oct 17, 2024
1 parent fef9a4b commit 77d1ce4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ local function takePicture()
message = 'camera',
toggle = false
})
Wait(10)
local tookPic = lib.callback.await('y_camera:server:takePicture', false)
if not tookPic then
exports.qbx_core:Notify(locale('error.takePicture'), 'error')
end
Wait(200)
lib.callback('y_camera:server:takePicture', false, function(tookPic)
if not tookPic then
exports.qbx_core:Notify(locale('error.takePicture'), 'error')
end
end)
Wait(200)
SendNUIMessage({
message = 'camera',
toggle = true
})
end

local function handleZoom()
Expand Down Expand Up @@ -129,14 +135,12 @@ local function openCamera()
handleCameraControls()
handleZoom()
if IsControlJustPressed(1, 176) or IsControlJustPressed(1, 24) then
inCam = false
qbx.playAudio({
audioName = 'Camera_Shoot',
audioRef = 'Phone_Soundset_Franklin',
source = cameraProp
})
takePicture()
resetCamera()
elseif IsControlJustPressed(1, 194) then
resetCamera()
end
Expand Down

0 comments on commit 77d1ce4

Please sign in to comment.