How do I make a C#-Script injectable on its own?
-
How do I modify a C#-Mod so that I can inject the .dll into the game without any other modifications (like ScripthookV // .NET) loaded into the game?
-
You would have to have ScriptHookV and ScriptHookVDotNet all included in the project since your script depends on both.
-
Thanks for the answer, and as it sounds pretty logical, I'll try it out and let you know if I manage to do it that way.
-
How exactly do I include them into my project, so that my script runs when I inject the .dll?
-
What you are asking is not possible. A managed C# DLL and an unmanaged DLL compiled to C/ C++ are two very different things. Native DLL's can be injected directly with LoadLibrary but .NET assemblies depend on the CLR and are not self- dependent in the same way.
-
How do some mod menus / trainers manage to do it then? Are they coded in C++ maybe?
Btw by "without any other modifications (like ScripthookV // .NET) loaded into the game?" I mean, that those other modifications aren't loaded sperately (-> using other .dll's placed in the GTA V main folder)
-
An asi mod is just a C++ dll. Some ... cheat menus with less legit use cases probably rely on external injectors or have their own ones. Those probably contain their own script hooks to use natives and stuff.
-
As mentioned before, it's not possible. The only reason I can imagine for what you are asking is the intention of modding in GTA Online. Correct me if I'm wrong but I'll have to lock this topic if that's the case.
-
I'm not going to code a mod designed for the use in GTA Online, but I want to code a mod that I don't have automatically loaded into the game whenever I launch it. Right now, I only use one mod in SinglePlayer, and that's a .NET mod, so I have several .dll's that I gotta remove everytime I want to play Online, using my own injectable mod, I can just quickly inject it whenever I play SP, and just don't do anything when going Online. It's just annoying as hell having to move those files everytime I play the game.
-
@d0nkey You don't have to move those files every time you load up an online game. One of the functions of the asi loader is that if it detects you are going online, by design, it will ignore loading scripthookvdotnet and all other plugins.
-
tldr;
@CamxxCore said in How do I make a C#-Script injectable on its own?:
What you are asking is not possible.
@OP focus on making an automated tool to switch from a GTA SP directory to a clean one in order to play Online.