Scripting Moderators ds1-e Posted July 25, 2019 Scripting Moderators Share Posted July 25, 2019 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
HassoN Posted July 25, 2019 Share Posted July 25, 2019 (edited) admin > client > gui > admin_report.Lua > line 42 Edited July 25, 2019 by HassoN 1 Link to comment
MTA Anti-Cheat Team Dutchman101 Posted July 25, 2019 MTA Anti-Cheat Team Share Posted July 25, 2019 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: 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: 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: So now you will have results on the bottom for all files in which it is found, like here: Double click the line to conveniently go to the relevant file and location of the result. Another example (a more common search; multiple hits): 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 1 Link to comment
Scripting Moderators ds1-e Posted July 25, 2019 Author Scripting Moderators Share Posted July 25, 2019 (edited) 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: 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: 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: So now you will have results on the bottom for all files in which it is found, like here: Double click the line to conveniently go to the relevant file and location of the result. Another example (a more common search; multiple hits): 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 , 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 July 25, 2019 by majqq Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now