Results 1 to 3 of 3
  1. #1
    DaniTR1's Avatar
    Join Date
    Dec 2017
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Load Custom Images/Sprites Help

    Hey im a noobie coder of gta v in my menu of gta v online i have got this code to load custom .ytd and show the images on it:
    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;
    }
    typedef bool(__fastcall* tFileRegister)(int*, const char*, bool, const char*, bool);
    bool FileRegister(int* textureID, std::string texturePath, bool enable, std::string textureName, bool _false)
    {
    static tFileRegister oFileRegister = (tFileRegister)(tFileRegister)(Memory:attern("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").count(1).get(0).get<void>(0));
    return oFileRegister;
    }
    void loadimages(HMODULE hmodule)
    {
    //ScriptMain
    const std::string name = "images_misc.ytd";
    std::string fullPath = GetModulePath(hmodule) + name;
    if (FileExists(fullPath))
    {
    int TextureID = 0;
    Log::Msg("Creating Textures");
    if(FileRegister(&TextureID, fullPath.c_str(), true, name.c_str(), false))
    {
    Log::Msg("Registered Texture %s with ID : %i", fullPath.c_str(), TextureID);
    }
    else
    {
    Log::Error("Failed to register %s", fullPath.c_str());
    Hooking::Cleanup();
    }

    }
    else
    {
    Log::Error("File Not Found ");
    }
    }
    void Hooking::Start(HMODULE hmoduleDLL)
    {

    loadimages(hmoduleDLL);
    }

    For some reason the menu load correctly but when i open in sp my game crashed and i dont know hot to fix it pls help me i dont finding a copy paste solution im finding an explanation

  2. #2
    KillerTrainz's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    14
    My Mood
    Amused

    Exclamation

    Quote Originally Posted by DaniTR1 View Post
    Hey im a noobie coder of gta v in my menu of gta v online i have got this code to load custom .ytd and show the images on it:
    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;
    }
    typedef bool(__fastcall* tFileRegister)(int*, const char*, bool, const char*, bool);
    bool FileRegister(int* textureID, std::string texturePath, bool enable, std::string textureName, bool _false)
    {
    static tFileRegister oFileRegister = (tFileRegister)(tFileRegister)(Memory:attern("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").count(1).get(0).get<void>(0));
    return oFileRegister;
    }
    void loadimages(HMODULE hmodule)
    {
    //ScriptMain
    const std::string name = "images_misc.ytd";
    std::string fullPath = GetModulePath(hmodule) + name;
    if (FileExists(fullPath))
    {
    int TextureID = 0;
    Log::Msg("Creating Textures");
    if(FileRegister(&TextureID, fullPath.c_str(), true, name.c_str(), false))
    {
    Log::Msg("Registered Texture %s with ID : %i", fullPath.c_str(), TextureID);
    }
    else
    {
    Log::Error("Failed to register %s", fullPath.c_str());
    Hooking::Cleanup();
    }

    }
    else
    {
    Log::Error("File Not Found ");
    }
    }
    void Hooking::Start(HMODULE hmoduleDLL)
    {

    loadimages(hmoduleDLL);
    }

    For some reason the menu load correctly but when i open in sp my game crashed and i dont know hot to fix it pls help me i dont finding a copy paste solution im finding an explanation
    I know a fix PM me ******* KillerGTAModz#6356

  3. #3
    sauceboss872394's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    1
    wish i could help, bumping!

Similar Threads

  1. [Help Request] Rotmg sprite help
    By balieboy in forum Realm of the Mad God Help & Requests
    Replies: 1
    Last Post: 07-16-2017, 10:48 PM
  2. [Help] Forcing game to load custom opengl32.dll ?
    By h4ck0ry in forum General Hacking
    Replies: 0
    Last Post: 10-29-2016, 02:47 PM
  3. [Help Request] AVA Load up error message help
    By OtterNamedChris in forum Alliance of Valiant Arms (AVA) Help
    Replies: 0
    Last Post: 08-04-2013, 07:21 PM
  4. [Help Request] Loading ERROR< CANT PLAY HELP?
    By jack893 in forum Realm of the Mad God Help & Requests
    Replies: 1
    Last Post: 06-04-2013, 11:55 AM
  5. [Help Request] Cannot Load image 'SHADOW' ? HELP! Also another error of ded server
    By MarketEngineer in forum Call of Duty Modern Warfare 3 Help
    Replies: 2
    Last Post: 05-06-2012, 06:20 AM