mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
Renamed the event so its more clear what it does and added a bool to denote when it's being disabled or not. This was attached to `isPhoneOpen` which wasn't reliablly working. Its now done within `showPhone` and `hidePhone`. The wait was changed from `1000` to `100` in the event the phone is opened before the wait is over. Makes it more smooth as there is no longer a small duration where the mouse moves the camera. Removed the enable of control actions as it wasn't needed.
24 lines
787 B
Lua
24 lines
787 B
Lua
local disableKeys
|
|
|
|
CreateThread(function()
|
|
while true do
|
|
if disableKeys then
|
|
Wait(0)
|
|
DisableControlAction(0, 1, true) -- Look Left/Right
|
|
DisableControlAction(0, 2, true) -- Look up/Down
|
|
DisableControlAction(0, 16, true) -- Next Weapon
|
|
DisableControlAction(0, 17, true) -- Select Previous Weapon
|
|
DisableControlAction(0, 22, true) -- Jump
|
|
DisableControlAction(0, 24, true) -- Attack
|
|
DisableControlAction(0, 25, true) -- Aim
|
|
DisableControlAction(0, 37, true) -- Weapon Wheel
|
|
else
|
|
Wait(100)
|
|
end
|
|
end
|
|
end)
|
|
|
|
RegisterNetEvent('npwd:disableControlActions')
|
|
AddEventHandler('npwd:disableControlActions', function(bool)
|
|
disableKeys = bool
|
|
end) |