diff --git a/fxmanifest.lua b/fxmanifest.lua index d774a08..ecb0d05 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -3,8 +3,9 @@ game "gta5" description 'js runtime monkaW' authors { "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw"} -client_script { - 'resources/dist/client/*.client.js' +client_scripts { + 'resources/dist/client/*.client.js', + 'resources/client/*.lua' } server_script { diff --git a/resources/client/cl_controls.lua b/resources/client/cl_controls.lua new file mode 100644 index 0000000..bf42d64 --- /dev/null +++ b/resources/client/cl_controls.lua @@ -0,0 +1,43 @@ +local disableKeys + +CreateThread(function() + while true do + if disableKeys then + Wait(0) + DisableControlAction(0, 0, true) -- Next Camera + 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, 26, true) -- Look Behind + DisableControlAction(0, 37, true) -- Weapon Wheel + DisableControlAction(0, 44, true) -- Cover + DisableControlAction(0, 47, true) -- Detonate + DisableControlAction(0, 55, true) -- Dive + DisableControlAction(0, 75, true) -- Exit Vehicle + DisableControlAction(0, 76, true) -- Vehicle Handbrake + DisableControlAction(0, 81, true) -- Next Radio (Vehicle) + DisableControlAction(0, 82, true) -- Previous Radio (Vehicle) + DisableControlAction(0, 91, true) -- Passenger Aim (Vehicle) + DisableControlAction(0, 92, true) -- Passenger Attack (Vehicle) + DisableControlAction(0, 99, true) -- Select Next Weapon (Vehicle) + DisableControlAction(0, 106, true) -- Control Override (Vehicle) + DisableControlAction(0, 114, true) -- Fly Attack (Flying) + DisableControlAction(0, 115, true) -- Next Weapon (Flying) + DisableControlAction(0, 121, true) -- Fly Camera (Flying) + DisableControlAction(0, 122, true) -- Control OVerride (Flying) + DisableControlAction(0, 135, true) -- Control OVerride (Sub) + DisableControlAction(0, 200, true) -- Pause Menu + DisableControlAction(0, 245, true) -- Chat + else + Wait(100) + end + end +end) + +AddEventHandler('npwd:disableControlActions', function(bool) + disableKeys = bool +end) \ No newline at end of file diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts index 003a115..cbd2128 100644 --- a/resources/client/cl_main.ts +++ b/resources/client/cl_main.ts @@ -57,6 +57,8 @@ const showPhone = async (): Promise => { sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, true); sendMessage('PHONE', PhoneEvents.SET_TIME, time); SetNuiFocus(true, true); + SetNuiFocusKeepInput(true); + emit('npwd:disableControlActions', true); }; const hidePhone = async (): Promise => { @@ -64,6 +66,8 @@ const hidePhone = async (): Promise => { sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, false); await phoneCloseAnim(); SetNuiFocus(false, false); + SetNuiFocusKeepInput(false); + emit('npwd:disableControlActions', false); }; /* * * * * * * * * * * * *