From 1a2f47d365a1d41ddbc3ab9ebcda4d5186d3f44f Mon Sep 17 00:00:00 2001 From: CallMeJ <73816044+realCallMeJ@users.noreply.github.com> Date: Fri, 2 Feb 2024 00:30:54 -1000 Subject: [PATCH 1/2] feat: disable npwd when cuffed --- client/cuff.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/cuff.lua b/client/cuff.lua index bb80c87..b72c693 100644 --- a/client/cuff.lua +++ b/client/cuff.lua @@ -1,5 +1,6 @@ local isCuffed = false local currentCuffType = "cuffs" +local npwd = GetResourceState("npwd") == "started" local cuffSounds = { cuffs = {"cuff", "uncuff"}, @@ -81,6 +82,9 @@ local function toggleHandsUp(status, animType) local state = Player(cache.serverId).state if state.gettingCuffed or state.isCuffed or state.isCuffing then return end + if npwd then + exports.npwd:setPhoneDisabled(status) + end exports.ox_target:disableTargeting(status) state:set("handsUp", status, true) handsUpStatus = status @@ -153,6 +157,8 @@ local function setCuffed(enabled, angle, cuffType) state:set("isCuffed", false, true) state:set("cuffType", false, true) exports.ox_target:disableTargeting(false) + if not npwd then return end + exports.npwd:setPhoneDisabled(false) return end @@ -168,6 +174,9 @@ local function setCuffed(enabled, angle, cuffType) state:set("isCuffed", true, true) state:set("cuffType", cuffType, true) exports.ox_target:disableTargeting(true) + if npwd then + exports.npwd:setPhoneDisabled(true) + end local entity = CreateObject(model, 0, 0, 0, true, true, true) AttachEntityToEntity(entity, ped, GetPedBoneIndex(ped, 0x49D9), pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, true, true, false, true, 1, true) From 1b3c3fc08e06c3643e76c9d1bd9cd51949298e16 Mon Sep 17 00:00:00 2001 From: Andy <86536434+Andyyy7666@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:51:49 +0100 Subject: [PATCH 2/2] Update cuff.lua --- client/cuff.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/cuff.lua b/client/cuff.lua index b72c693..2a057ee 100644 --- a/client/cuff.lua +++ b/client/cuff.lua @@ -85,6 +85,7 @@ local function toggleHandsUp(status, animType) if npwd then exports.npwd:setPhoneDisabled(status) end + exports.ox_target:disableTargeting(status) state:set("handsUp", status, true) handsUpStatus = status @@ -157,9 +158,7 @@ local function setCuffed(enabled, angle, cuffType) state:set("isCuffed", false, true) state:set("cuffType", false, true) exports.ox_target:disableTargeting(false) - if not npwd then return end - exports.npwd:setPhoneDisabled(false) - return + return npwd and exports.npwd:setPhoneDisabled(false) end local ped = cache.ped @@ -174,6 +173,7 @@ local function setCuffed(enabled, angle, cuffType) state:set("isCuffed", true, true) state:set("cuffType", cuffType, true) exports.ox_target:disableTargeting(true) + if npwd then exports.npwd:setPhoneDisabled(true) end