My my own mod menu
Hi its a dream of me to make my own mod menu since i got sth. To play on. I started learning the basics of c++ and would like to know how to code a mod menu with a c++ base with visual studio. How to compile it and later make it run in gta 5 steam And socialclub. I need a very good explained source or a tutorial from downloading needed base to kompile and run it. A video tutorial or a german text tutorial would be great!:) but a txt tutorial is good tho (a text tutorial like this only in c++ would be great:
[C#][NativeUI] How to create a mod menu.;)thx
(Moderators i hope the reupload is in the right place and is not breaking any rules)
It's already been explained that discussion of modding GTA:O is prohibited. Making a menu for Story Mode is fine.
@ikt i know i just wanted to know how to Code 1 in story
I'm just gonna give a quick overview of making script mods with the ScriptHookV SDK. There is ScriptHookVDotNet too, but that's .NET languages (C#, VB, etc) so here's SHV's C++.
Start out with getting acquainted to the examples. Download the SDK for ScriptHookV, which contains a bunch of examples with explanations of what things do. If you haven't already, grab a copy of Visual Studio Community, with which you can open solution files the SDK has.
Let's take NativeTrainer for example. Just open the solution file (NativeTrainer.sln) and if VS asks you to upgrade the solution, do that. The solution explorer shows a bunch of .cpp and .h files. If you don't know what these are, I highly recommend getting somewhat acquainted to C/C++ first. (Syntax, headers and source files, default programmy stuff).
For ScriptHookV's example, the
script.cppis the most important file, which contains all implementation. If you go way to the bottom, there's some initialization code there. ScriptMain() is called upon loading, which in turn calls main(). From there it monitors key presses and updates the menu and options. I'm not going to go into detail about the whole trainer, but it calls native functions to draw things on screen and change the game world.
If you go into natives.h, it lists the natives with their arguments. Call them with the namespace::function thing that C++ does.
For example, to draw a rectangle, you can call this:
GRAPHICS::DRAW_RECT(x, y, width, height, color.r, color.g, color.b, color.a);
With this, the boxes and stuff are drawn for the menu background. That's basically the specifics of ScriptHookV. There are natives which you can call which do things in-game. An updated list of natives is available here and also a bit of documentation. Not all natives have been documented but whatever is, should be plenty to get a basic menu working. Finally, just hitting compile on a ScriptHookV-based solution and everything should compile right away. If you make a solution from scratch, you'll need to set up your include folders and add ScriptHookV.lib to the linker options, as well as making sure the default output is a .asi.
As for the menu, there are different ways to manage a menu. You can take existing bases or code up one for yourself. I personally took one from Sudomod and changed bits here and there, depends on your needs and wants.
Also there are already plenty of complete and nice menus laying around, like Menyoo and Simple Trainer, so I wouldn't do the duplicate work if I were you. Aside from the memory tidbits from Menyoo, most trainers just work with natives and globals to toggle/change some game features.
Also I highly recommend to take a look at ScriptHookVDotNet. It supports C# which is vastly easier than C++ and abstracts things very very nicely, as well as offering some more advanced functionality which would need more manual memory editing in SHV/C++. There's even a proper Menu/UI library (NativeUI) for it, so you can not worry about getting the menu base working, but focus on the features and discovering what you can do with mods instead.
Also a bit of self-promotion, I tried to mirror the functionality (partly) in my own base which I use for some of my mods.
@ikt can you give me a full tutorial please?
@ikt i think ill mess around with scripthook a bit and than use your base. But is your base sth for a standalone menu(dssound.dll and menu/ File to inject with xenos) or Do I still need sth live scripthook in my gta folder?
I think you're thinking of the wrong concept. When I talk about a "menu", it's the UI and navigation elements. I think you just want another one of those trainers.
Anyway, once it's compiled it's just a dll. The asi extension just makes the asi loader attach the dll and ScriptHookV is just a library to call natives. You can make your own hash translation tables to get your script to call natives correctly, but there is no real reason to with regular mods. It'll be necessary when you mess around with GTA:O or want to get things working before AB releases a next scripthook for a next update, but these aren't problems you should worry about if you simply want to make a SP trainer.
@ikt can you give me a full tutorial please?
Just learn the basic concepts, it's not astonishingly much to wrap your head around, but you do need a bit of understanding before you can start doing what you want to do. Start small and take your stuff wherever your motivation is willing to take you.
@ikt thanks id like to ask you some more questions can i contact you on discord?
I highly encourage you to go and experiment with ScriptHookV though.