[How-To] GTAV - Create a Plugin/Script

Posts 1–13 of 13 · Page 1 of 1
[How-To] GTAV - Create a Plugin/Script
Grand Theft Auto V - Plugin/Script Creation

Requirements:
Windows System
Microsoft Visual Studio 2010 (or Higher)
Notepad++ (Optional)
Basic Knowledge of C++

Open Microsoft Visual Studio and start a new project.



Under Visual C++ templates, select 'Win32 Console Application', name your project and press OK.



This will take you to the application wizard, press next and select 'DLL' as the application type and 'Empty Project' under additional options, then press finish.



You now have a blank DLL project that you can work with.



Add "GtaSDK.h" and "GtaSDK.cpp" to the project by right clicking the project and navigating to "Add->New Item". Remember that .cpp is 'Source Files' and .h is 'Header Files'.


http://i.imgur.com/nrTtjgW.gif



Code:
#include "GtaSDK.h"

/* Called every game tick */
PLUGIN_API VOID OnTick()
{
	Player player = GPLAYER->PLAYER_ID();

	GGAMEPLAY->SET_FIRE_AMMO_THIS_FRAME(player);
	GGAMEPLAY->SET_EXPLOSIVE_AMMO_THIS_FRAME(player);
}

/* Called once when the plugin is loaded */
PLUGIN_API VOID OnLoad(CPluginSDK* PluginSDK)
{
	LOAD_PLUGINSDK();
}

/* Called once when the plugin is unloaded */
PLUGIN_API VOID OnUnload()
{

}

Now add a new source file called "Anything.cpp"




Code:
#include "GtaSDK.h"

DWORD GTimer = 0;
Any GBagHash = 0;
Any GCaseHash = 0;

PLUGIN_API VOID OnTick()
{
	if (GetTickCount() - GTimer >= 500)
	{
		Vector3 pos = GENTITY->GET_ENTITY_COORDS(GPLAYER->PLAYER_PED_ID(), 0);

		GSTREAMING->REQUEST_MODEL(GBagHash);
		if (GSTREAMING->HAS_MODEL_LOADED(GBagHash))
		{
			GOBJECT->CREATE_AMBIENT_PICKUP(GCaseHash, pos.x, pos.y, pos.z + 1, 0, 40000, GBagHash, 0, 1);
			GSTREAMING->SET_MODEL_AS_NO_LONGER_NEEDED(GBagHash);
		}

		GTimer = GetTickCount();
	}
}

PLUGIN_API VOID OnLoad(CPluginSDK* PluginSDK)
{
	LOAD_PLUGINSDK();

	GBagHash = GGAMEPLAY->GET_HASH_KEY("prop_money_bag_01");
	GCaseHash = GGAMEPLAY->GET_HASH_KEY("PICKUP_MONEY_CASE");
}

PLUGIN_API VOID OnUnload()
{

}

Right click your project and press properties at the very bottom, you should see a button near the top right that says 'Configuration Manager' that you'll want to open.


Press the drop down box on platform and select new. Under new platform, navigate to x64 and press Ok, In the Configuration drop down select Release then Close.


Now simply build your project and it should generate \x64\Release\Anything.dll


Place that DLL in the GTAPlugins directory of your loader and you should be able to now run it from the cheat.


Moved to the tutorial section. Please use the correct section (they have descriptions if you're ever confused). Nice tutorial and images for beginners or people with limited experience though.
Quote Originally Posted by Khyy View Post
Moved to the tutorial section. Please use the correct section (they have descriptions if you're ever confused). Nice tutorial and images for beginners or people with limited experience though.
Ty. Ya sorry, i didn't see a tutorial section at first.
Quote Originally Posted by Z-Nation View Post
Ty. Ya sorry, i didn't see a tutorial section at first.
You're fine man. Just keep up the good effort as repayment! :P
Fantastic .gif images. I can tell you spent time on this post, so I just want to say thanks. I appreciate this easy to read professional tutorial.
!Bump!

// To Short
Hm, how do you find the function names though? Is there a reference?
Thank you for this tutorial but I don't think I understand. Where do I find the gtaSdk.h to compile with in the first place,
and in case it's a file we're creating ourselves (I am not using an IDE), I still can't compile because there's only one header file you had us include and it doesn't define (any of ?) all the types we are using.
I think there's something I didn't understand.
Can someone please help me about this ?
Thank you in advance.
Okay so what my plan of action is basically find a source menu and then use this method to edit it and compile it as a dll
I suggest you go look for documentation elsewhere. I did.
Thanks for that, the gifs are amazing when understanding the whole process <3
I think if you JTAG your xbox you can use it, but not for PS3, though I did this and it worked for PC
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us