I'm pretty new to modding on GTA 5 (As in C++ wise) and I was thinking of adding a custom banner for a mod menu. I have the banner and ytd done all I need to know is how to actually implement it.
For example found this code but don't really know what to do with it.
For example found this code but don't really know what to do with it.
Code:
GameFunction:
static uint32*(*FileRegister)(int*, const char*, bool, const char*, bool) = "48 89 5C 24 ? 48 89 6C 24 ? 48 89 7C 24 ? 41 54 41 56 41 57 48 83 EC 50 48 8B EA 4C 8B FA 48 8B D9 4D 85 C9"_scan.as<decltype(FileRegister)>();
Generic Functions:
bool FileExists(const std::string& fileName)
{
struct stat buffer;
return (stat(fileName.c_str(), &buffer) == 0);
}
const std::string GetModulePath(HMODULE module)
{
std::string path;
char buffer[MAX_PATH];
GetModuleFileNameA(module, buffer, MAX_PATH);
PathRemoveFileSpecA(buffer);
path = buffer;
return path;
}
USAGE:
//ScriptMain
const std::string name = "title_images.ytd";
const std::string delim = "\\";
std::string fullPath = GetModulePath(YOUR_DLL_MODULE) + delim + name;
if (FileExists(fullPath))
{
int textureID;
FileRegister(&textureID, fullPath.c_str(), true, name.c_str(), false);
if (textureID == -1)
{
_error("Failed to register %s", fullPath.c_str());
}
else
{
_print("Registered File %s with ID:%i", fullPath.c_str(), textureID);
}
}
*use the name as the textureDict without extension
eg.
Sprite("title_images", "forum_banner", 0.f, { 255, 255, 255, 255 })