How sulemarevientu/gameplayfixesv-scripthookv works
Project type and purpose
• This is a native-code GTA V mod (an .asi plugin) built with Visual Studio and loaded at runtime by ScriptHookV.
• Its purpose is to hook into GTA V’s scripting engine, read a user-configurable INI, and call game “native” functions to enable/disable gameplay features.
File structure
Top-level items:
• GameplayFixesV.sln / .vcxproj – Visual Studio solution/project
• bin/Release/GameplayFixesV.asi – the compiled plugin
• bin/Release/GameplayFixesV.ini – runtime configuration file
• inc/ – headers for ScriptHookV, SimpleIni, natives, enums, types
• lib/ScriptHookV.lib – import library to link against ScriptHookV
• source/ – core logic
– main.cpp, script.cpp, globals.h
– utils/ (functions, ini loader, keyboard, peds)
README for additional insights
• The mod never patches game binaries directly; it makes native calls via ScriptHookV.
• SimpleIni is used for INI parsing.
• Features are grouped by category (Player, HUD, Audio, etc.), each implemented in code under source/utils or script.cpp.
Main components
a. GTA V Game Engine (host process)
b. ScriptHookV (hook/dll injector + scripting runtime)
c. GameplayFixesV.asi plugin
d. SimpleIni library (INI parsing)
e. Configuration file (GameplayFixesV.ini)
f. Internal modules:
• Script Entry & Tick Loop (script.cpp / main.cpp)
• Feature modules (utils/functions.cpp, keyboard.cpp, peds.cpp, ini.cpp)
• Native Caller (nativeCaller.h + natives.h)
Relationships & interactions
• On GTA V startup, ScriptHookV injects and loads all .asi plugins, including GameplayFixesV.asi.
• The plugin’s entry point (main.cpp) registers an update callback in ScriptHookV’s scripting runtime.
• At each game tick:
1. The plugin reads or reloads the INI (via SimpleIni).
2. It checks input (keyboard module) for reload key or toggle keys.
3. For each enabled feature, it invokes the corresponding function in utils/ (which wraps one or more native calls).
4. The Native Caller layer translates high-level calls into GTA V’s native API.
• All calls execute inside the GTA V process space, altering game state at runtime.
Architectural patterns and principles
• Modular design: separate “feature” modules in source/utils, plus a central script loop.
• Dependency injection: config values flow into feature modules.
• Layered calls: ScriptHookV → plugin entry → feature logic → native API.