Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new onClientCoreCommand event #2554

Merged

Conversation

Pieter-Dewachter
Copy link
Contributor

MTA has a few built-in clientside commands, however there is currently no way for scripts to know if any of those commands were executed. All existing ways of retrieving such info don't work for various reasons, namely: onPlayerCommand, addCommandHandler and onClientConsole. This pull request adds a new clientside event onClientCoreCommand which gets triggered for those specific commands, with one parameter: string command.

FYI: There are a lot of built-in client commands,, some are written here as reference:

  • help
  • ver
  • time
  • showhud
  • serial
  • bind
  • unbind
  • copygtacontrols
  • screenshots
  • saveconfig
  • cleardebug
  • test
  • showmemstat
  • showframegraph
  • fakelag
  • shownametags
  • showchat
  • shownetstat
  • showcol
  • showsound
  • ...

@lopezloo lopezloo added the enhancement New feature or request label Feb 18, 2022
@lopezloo
Copy link
Member

What is the use case for this? I see point in triggering such event for commands like "showchat", "showhud" or "shownametags" but why for all commands?

@Pieter-Dewachter
Copy link
Contributor Author

I personally would use it for "showchat" and "time", but I figured other people could have a use for the other commands as well.

@patrikjuvonen
Copy link
Contributor

I don't see the point in this.

@patrikjuvonen patrikjuvonen added the feedback Further information is requested label Apr 8, 2023
@PlatinMTA
Copy link
Contributor

You can't really add command handlers for hardcoded commands. For example if I want to make a command using /ver I can't, I need to name it differently. This should help.

@ffsPLASMA
Copy link
Contributor

You would have to blacklist certain commands like login/register as you could simply build a keylogger for them.

@Fernando-A-Rocha
Copy link
Contributor

You would have to blacklist certain commands like login/register as you could simply build a keylogger for them.

https://wiki.multitheftauto.com/wiki/Client_Commands

login/register aren't client commands, and register isn't even an MTA command, it's built into the admin panel resource.

The only client command that pontentially exposes a password is connect <host> [<port> <nick> <pass>].

It would be useful to detect when the player uses /help or /time to display other stuff in the chatbox or in some UI.

@Proxy-99
Copy link
Contributor

Proxy-99 commented Jul 3, 2024

I think it can be useful with side scripting with those commands to add extra functionality to them

@Dutchman101 Dutchman101 merged commit b2cf029 into multitheftauto:master Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feedback Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants