I saw micitos post about it, it was posted year ago, has anyone found the way? can we do it?
Disabling key binds while using CUI input field?
Mounting the player to an invisible mountable will address movement. Hooking OnServerCommand and blocking various commands, like the new version of Kits does, can cover a lot of cases as well. If there are some things still not being blocked, you could try tricks like showing certain vanilla UIs that block various binds, such as vendor dialogue, but I havent tried that before.
WhiteThunder
Mounting the player to an invisible mountable will address movement. Hooking OnServerCommand and blocking various commands, like the new version of Kits does, can cover a lot of cases as well. If there are some things still not being blocked, you could try tricks like showing certain vanilla UIs that block various binds, such as vendor dialogue, but I havent tried that before.
The problem is that Kits does not do that, You cannot enter text in the CUI that contains any bound keys such as :
"i" for inventory or "b" for backpack
so i have to create a single letter kit, then add kit items, cooldown , max uses in cui then unload kits (have to wait till server empty) then edit kit data file for actual name i want and description , save then reload kits. I have posted this information a number of times but with the amount of plugins that Killyou has (and actual life which counts more) it might be a while before this is remedied,
OnServerCommand probably only blocks vanilla commands for things like switching seats and toggling flashlight. I think you can block plugin commands, such as for opening a backpack, with OnPlayerCommand or OnUserCommand (universal).
Merged post
I was just testing the current version of Rust Kits, and it does indeed block backpacks from opening (backpacks.open console command), which is covered by OnServerCommand. Commands like crafting menu, inventory and map are unfortunately client-side so they can't be blocked unless you are dead perhaps. The map can at least show up behind the menu if it's parented to "Overlay" instead of to "Hud". Kits seems to have a peculiar design in that you can't type into any input field that you previously typed into without starting over, which becomes a problem if you got interrupted by opening your inventory for instance.
I tested and confirmed that being "dead" from the client-perspective does prevent you from opening the crafting menu or your inventory. That could be paired with a full screen UI so that you don't see the respawn screen behind it. One minor issue is that I believe you will be invisible for other players while in the "dead" state, so you would either have to use a dummy, which is fairly error-prone, or use selective networking (OnEntitySaved(BasePlayer)) which is not performance friendly but could be acceptable for a short duration.
i know this is old but what works for me is to set player to spectating on menu open and disable after menu close
player.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, true); Last year, Rust added native CUI support for blocking movement by setting a needs keyboard property.
Glad to have found this post. This has been highly annoying for some time. Adding NeedsKeyboard = true to your input function works wonders.