fivem
fivem copied to clipboard
feat(mumble): resolve push-to-talk not working inside menu/map
usage IS_DISABLED_CONTROL_PRESSED fix problem when we cant talk with open menu/map but still we can disable this control by DISABLE_ALL_CONTROL_ACTIONS etc.
We need this change to be 100% functional
Yes! this is really important!
Sadly this solution is very rough and have very annoying side effects. For example, if you press N
(default push-to-talk control) and keep talking, while trying to open in-game chat (or do anything that would block the controls in general, open map, alt-tab and etc), the state of pressed N
would be frozen until you press it again. So player would keep talking even when he doesn't want to. That's why FiveM have a bit more complex realization of such a feature. I would prefer to avoid such annoying "side effect", for me the benefits of this PR aren't comparable to the problems that this solution makes.
Hopefully in the future it will have a better solution
If I'm not mistaken the problems you write about already occur in the game. Running any NUI overlay causes the pressed state of N to be frozen until pressed again. Same if you pressing N and open console. So you need to add something like this to your scripts
SetNuiFocus(true, true)
SetNuiFocusKeepInput(true)
DisableControlsKey()
function DisableControlsKey()
Citizen.CreateThread(function()
while isInventoryOpen do
Wait(0)
DisableAllControlActions(0)
EnableControlAction(0, 0x4BC9DABB, true) -- INPUT_PUSH_TO_TALK
end
end)
end
https://streamable.com/qxo8fw left bottom corner microphone icon
Would it not make sense to just use IsDisabledControlPressed
for GTA and RDR?
This would fix an issue for pma-voice where you can't use radio (or simulate PTT) while in the map because every control action gets disabled
@Disquse What do you think about it?