RedM Natives

_CREATE_GRAVITY_WELL

Creates a handle to an instance of "CScriptResource_GravityWell", this system forces local ped to target specified position when moving, however player still can interrupt this.

Hash0x4F5EBE70081E5A20
Runtime nameCreateGravityWell
NamespacePED
SideClient
NameCommunity guess
Docs
Since build1207

Signature

int _CREATE_GRAVITY_WELL(float xPos, float yPos, float zPos, float heading, float radius, float p5, float p6, float p7, BOOL stopAtDestination);

Parameters

NameTypeDescription
xPosfloat—
yPosfloat—
zPosfloat—
headingfloat—
radiusfloat—
p5float—
p6float—
p7float—
stopAtDestinationBOOL—

Returns int

Description

Creates a handle to an instance of "CScriptResource_GravityWell", this system forces local ped to target specified position when moving, however player still can interrupt this.
Can be useful to "point" player at some specific position.
Only works while on-foot.

_CREATE_[P-Z]

Usage

Lua
local retval = CreateGravityWell(xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination)

-- always works, by hash
local retval = Citizen.InvokeNative(0x4F5EBE70081E5A20, xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = CreateGravityWell(xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination);

// by hash
const retval = Citizen.invokeNative('0x4F5EBE70081E5A20', xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, heading + 0.0000001, radius + 0.0000001, p5 + 0.0000001, p6 + 0.0000001, p7 + 0.0000001, stopAtDestination, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x4F5EBE70081E5A20, xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

See also

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.