[This is preliminary documentation and is subject to change.]
Represents a dynamic object that can be used to invoke natives.
SystemObject System.DynamicDynamicObject Rage.NativeDynamicNativeFunction
Namespace:
Rage.Native
Assembly:
RagePluginHook (in RagePluginHook.dll) Version: 0.0.0.0 (0.56.1131.11510)
public sealed class DynamicNativeFunction : DynamicObject
Public NotInheritable Class DynamicNativeFunction
Inherits DynamicObject
public ref class DynamicNativeFunction sealed : public DynamicObject
The DynamicNativeFunction type exposes the following members.
Top
Calls made on the dynamic object will be resolved at runtime rather than compile time, so calling any non-existing method on this object will work at compile time, but may fail at runtime.
When the code runs, the name of the method will be resolved to a native name.
Names can be formatted in two ways. The native's actual name, or its name without underscores, in PascalCase. For example, the two following code snippets will invoke the native STOP_PLAYER_TELEPORT.
Rage.Native.NativeFunction.Natives.STOP_PLAYER_TELEPORT();
Rage.Native.NativeFunction.Natives.STOP_PLAYER_TELEPORT()
No code example is currently available or this language may not be supported.
Rage.Native.NativeFunction.Natives.StopPlayerTeleport();
Rage.Native.NativeFunction.Natives.StopPlayerTeleport()
No code example is currently available or this language may not be supported.
Arguments can be passed to natives using traditional method call syntax.
Certain types like
IHandleables or
Player, will be converted to their handle, so it's unnecessary to call
Handle on an object:
Rage.Native.NativeFunction.Natives.SET_PLAYER_MODEL(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"));
Rage.Native.NativeFunction.Natives.SET_PLAYER_MODEL(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"))
No code example is currently available or this language may not be supported.
Rage.Native.NativeFunction.Natives.SetPlayerModel(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"));
Rage.Native.NativeFunction.Natives.SetPlayerModel(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"))
No code example is currently available or this language may not be supported.
Natives can also be called using their original 64-bit value (a.k.a. hash). To call a native by its hash, begin the method name with x followed by the 64-bit value:
Rage.Native.NativeFunction.Natives.x00A1CADD00108836(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"));
Rage.Native.NativeFunction.Natives.x00A1CADD00108836(Rage.Game.LocalPlayer, Rage.Game.GetHashKey("PLAYER_ZERO"))
No code example is currently available or this language may not be supported.
If a native returns a value, the return type must be indicated as the first and only generic type argument.
uint vehicleHandle = Rage.Native.NativeFunction.Natives.GetVehiclePedIsTryingToEnter<uint>(Rage.Game.LocalPlayer.Character);
Dim vehicleHandle As UInteger = Rage.Native.NativeFunction.Natives.GetVehiclePedIsTryingToEnter(Of UInteger)(Rage.Game.LocalPlayer.Character)
No code example is currently available or this language may not be supported.
If the native returns a handle to one of the most common
IHandleable types (
Ped,
Vehicle,
Object,
Blip,
Group), the return type can be specified as one of these types, and RAGE Plugin Hook will automatically convert the handle to the specified
IHandleable type.
Rage.Vehicle vehicle = Rage.Native.NativeFunction.Natives.GetVehiclePedIsTryingToEnter<Rage.Vehicle>(Rage.Game.LocalPlayer.Character);
Dim vehicle As Rage.Vehicle = Rage.Native.NativeFunction.Natives.GetVehiclePedIsTryingToEnter(Of Rage.Vehicle)(Rage.Game.LocalPlayer.Character)
No code example is currently available or this language may not be supported.
Reference