Hello!
First of all, thanks for maintaining this documentation.
I have written a Python script that parses rdr3natives.json and automatically generates a fully typed C# wrapper class (RedMNatives.cs).
The Problem:
Currently, the standard CitizenFX client library for RedM does not expose all available natives. C# developers often encounter missing methods and are forced to manually look up hashes and cast types using generic Function.Call.
The Solution:
This script automates that process and generates a complete wrapper file based on your documentation. It bridges the gap between the available documentation and the incomplete C# API.
Key Features:
- Completeness: Provides access to all natives listed in
rdr3natives.json, not just the ones currently in CitizenFX.
- Strong Typing: Automatically maps types (e.g.,
BOOL -> bool, Vector3) and handles complex ref / pointer parameters using OutputArgument.
- IntelliSense: Injects the documentation and comments from the JSON directly into the IDE for easy development.
Example Output:
/// <summary>
/// Native: _SET_RANDOM_OUTFIT_VARIATION
/// </summary>
/// <remarks>Hash: 0x283978A15512B2FE | Category: PED</remarks>
public static void SetRandomOutfitVariation(int ped, bool p1)
{
Function.Call((Hash)0x283978A15512B2FE, ped, p1);
}
Proposal:
I would like to contribute this script as a tool (e.g., generate_cs.py) to this repository. It would allow users to generate the latest, complete C# bindings whenever the documentation is updated.
Let me know if you are interested, and I will submit a Pull Request!
Hello!
First of all, thanks for maintaining this documentation.
I have written a Python script that parses
rdr3natives.jsonand automatically generates a fully typed C# wrapper class (RedMNatives.cs).The Problem:
Currently, the standard CitizenFX client library for RedM does not expose all available natives. C# developers often encounter missing methods and are forced to manually look up hashes and cast types using generic
Function.Call.The Solution:
This script automates that process and generates a complete wrapper file based on your documentation. It bridges the gap between the available documentation and the incomplete C# API.
Key Features:
rdr3natives.json, not just the ones currently in CitizenFX.BOOL->bool,Vector3) and handles complexref/ pointer parameters usingOutputArgument.Example Output:
Proposal:
I would like to contribute this script as a tool (e.g.,
generate_cs.py) to this repository. It would allow users to generate the latest, complete C# bindings whenever the documentation is updated.Let me know if you are interested, and I will submit a Pull Request!