Jump to content

Disable report command


ds1-e

Recommended Posts

  • Scripting Moderators

Hey, how i can disable /report command? I want to use that for something else. I was looking and i couldn't find it.

Link to comment
  • MTA Anti-Cheat Team
1 hour ago, majqq said:

I was looking and i couldn't find it.

Just a little advise: if you're trying to find something (on Windows; non-grep) in future, then use Notepad++ and:

1) open your windows explorer and navigate to your gamemode's root directory

2) search there for: *.Lua like this:

PSoB2kB.png

Now, your search results will be all script files in all of your gamemode resources.

3) press CTRL + A (select all script files), and right click > "Edit with Notepad++" like this:

 

lr8lmvy.png

 

So when you clicked that, it will open all code files at the same time (Notepad++ supports having files open simultaneously). This may take a while depending on their amount and your gamemode's size, and whether or not you're using the 64-bit version of Notepad++; just be patient and wait until it's loaded.

Now, we are going to search a keyword that refers to what you want to find. As you can imagine, all commands in your gamemode can be found on the term addCommandHandler, but commands also start with either ' or " so for this example, we are going to search for this keyword:

Quote

"report

(including the quote for aforementioned reason)

I explained that part so you can learn how to find specific categories of things, by figuring the hints it may hold.

So now, let's do the actual search:

Notepad++ search box (CTRL + F) > "Find All in All Opened Documents", this is the trick. It will search all of your gamemode, because you got all script files opened at the same time.

Like this:

IL1xaov.png

So now you will have results on the bottom for all files in which it is found, like here:

6rakZq5.png

Double click the line to conveniently go to the relevant file and location of the result.

Another example (a more common search; multiple hits):

MAxfFWq.png

 

This method will help anyone that doesn't know their codebase very well in and out/knows where everything is located.

It's not only used for locating a function that you know exists somewhere, but also to find all scripts/functions that deal with a specific thing (obvious but - for example if there are bugs with vehicle fixing, you would search for fixVehicle and/or setElementHealth, to evaluate the code of all occurences for a flaw).

@majqq

  • Like 1
Link to comment
  • Scripting Moderators
1 hour ago, Dutchman101 said:

Just a little advise: if you're trying to find something (on Windows; non-grep) in future, then use Notepad++ and:

1) open your windows explorer and navigate to your gamemode's root directory

2) search there for: *.Lua like this:

PSoB2kB.png

Now, your search results will be all script files in all of your gamemode resources.

3) press CTRL + A (select all script files), and right click > "Edit with Notepad++" like this:

 

lr8lmvy.png

 

So when you clicked that, it will open all code files at the same time (Notepad++ supports having files open simultaneously). This may take a while depending on their amount and your gamemode's size, and whether or not you're using the 64-bit version of Notepad++; just be patient and wait until it's loaded.

Now, we are going to search a keyword that refers to what you want to find. As you can imagine, all commands in your gamemode can be found on the term addCommandHandler, but commands also start with either ' or " so for this example, we are going to search for this keyword:

I explained that part so you can learn how to find specific categories of things, by figuring the hints it may hold.

So now, let's do the actual search:

Notepad++ search box (CTRL + F) > "Find All in All Opened Documents", this is the trick. It will search all of your gamemode, because you got all script files opened at the same time.

Like this:

IL1xaov.png

So now you will have results on the bottom for all files in which it is found, like here:

6rakZq5.png

Double click the line to conveniently go to the relevant file and location of the result.

Another example (a more common search; multiple hits):

MAxfFWq.png

 

This method will help anyone that doesn't know their codebase very well in and out/knows where everything is located.

It's not only used for locating a function that you know exists somewhere, but also to find all scripts/functions that deal with a specific thing (obvious but - for example if there are bugs with vehicle fixing, you would search for fixVehicle and/or setElementHealth, to evaluate the code of all occurences for a flaw).

@majqq

Yes i know about first thing. I was thinking that "report thing" exist somewhere else, in script file which isn't directly called admin_report, i am not sure why i missed gui folder :P, about "find all in all opened documents" - great feature, which i've never used, thanks.

EDIT: I've just noticed, that nearly same feature exists also in Sublime Text 3, which i prefer to use.

Edited by majqq
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...