Scripthook Rdr2 -
void ScriptMain() while (true) if (IsKeyPressed(VK_F9)) // do something
WAIT(0); // mandatory
#include "script.h" void main() // runs once when plugin loads scripthook rdr2
| Namespace | Purpose | |-----------|---------| | PLAYER | Get player ped, wanted level, money | | ENTITY | Set position, heading, velocity | | PED | Create peds, set health, weapons | | VEHICLE | Spawn cars/wagons, control doors | | TASK | Make peds move, follow, fight | | UI | Show notifications, subtitle text | | MISC | Get/set time, weather, random ints | 5. Common Issues & Solutions | Problem | Likely Cause | Fix | |---------|--------------|-----| | Game crashes on launch | Game updated, ScriptHook outdated | Wait for new version or downgrade game | | Failed to load ScriptHookRDR2.dll | Antivirus or missing VC++ runtime | Add folder exception; install VC++ 2015-2022 x64 | | No F3/F4 trainer | NativeTrainer.asi missing or conflict | Re-download; remove other trainers temporarily | | ASI mods not loading | Incorrect folder or missing dinput8.dll | Ensure dinput8 is present; check log file | | SCRIPT HOOK CRITICAL ERROR | Two ScriptHook copies or corrupted | Delete all ScriptHook files, reinstall fresh | | Online mode won’t start | ScriptHook hooks into game – anti-cheat | Never play online with ScriptHook installed . Remove DLLs before going online. | 6. ScriptHook vs. Other Modding Frameworks | Tool | Type | Use Case | |------|------|----------| | ScriptHook RDR2 | ASI loader + native invoker | New gameplay, trainers, hotkeys, real-time logic | | Lenny’s Mod Loader (LML) | Asset replacer + .ytd / .ymt loader | Texture mods, custom weapons, changed stats | | RDR2 Save Editor | Offline save file tool | Edit money, honor, inventory, missions | | Map Editor (Codewalker) | Map placement tool | Add buildings, props, animals to world | | OpenIV | Archive explorer | Extract/replace game files (dangerous, often detected) | while (!STREAMING::HAS_MODEL_LOADED(horseModel)) WAIT(0)
#include "script.h" void spawn_horse() Hash horseModel = GAMEPLAY::GET_HASH_KEY("ARABIAN_BLACK"); STREAMING::REQUEST_MODEL(horseModel); while (!STREAMING::HAS_MODEL_LOADED(horseModel)) WAIT(0); scripthook rdr2