Ironz
Newbie
Grand Theft Auto V - Plugin/Script Creation
Requirements:
Windows System
Microsoft Visual Studio 2010 (or Higher)
Notepad++ (Optional)
Basic Knowledge of C++
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.