Having a feature to know if the player’s console is open could be nice!
Something like this syntax:
if IsGameConsoleOpen() then
print("it is")
end
This native could be easily made by FiveM and could add more to FiveM’s scripting community!
Alternate names for the native:
IsGameConsoleActive()
IsConsoleOpen()
IsConsoleActive()
GetConsoleState()
Do you maybe have a more actionable use-case for this rather than just printing if the console is currently opened?
I honestly cannot think of a use-case for this that would improve the player experience in any way. (You don’t want to kick a player for opening the console right?)
No, I’m going to open DevTools on your NUI and there’s nothing you can do about it!!! MUHAHAHA /s
Seriously tho, there is not a single real use case to have this. Mainly because I can open most console tools before connecting to a server (and then I can steal your NUI)
This is the equivalent of people using the F8 meme kick from a couple of years ago. You’re not stopping anyone. You’re just showing your insecurities.
Well, you cannot, and there is no point on doing so anyways (assuming you’re referring to the external endpoint).
A little tampering with [the well-known shark program] can get you the contents of ui pages.
If this is an attempt to mitigate a vulnerability in the said NUI pages that you may have then this is not something that would fix it, just another slap on the wrist. A better approach would be to fix the issue itself.
To add to the other well explained replies:
If that’s about the “new” approach to combat cheaters with reading mouse movement on screen and then checking for certain “patterns” with well-known “3rd party tools”, this is already outdated again, as those tools now don’t block input to the game window when their menu has focus, so dead-end. (Though this was a great approach when they didn’t)