_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.
Hash
0x4F5EBE70081E5A20Runtime name
CreateGravityWellNamespacePED
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
| Name | Type | Description |
|---|---|---|
xPos | float | — |
yPos | float | — |
zPos | float | — |
heading | float | — |
radius | float | — |
p5 | float | — |
p6 | float | — |
p7 | float | — |
stopAtDestination | BOOL | — |
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
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#
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());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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
InvokeNativewith the hash — it always works.
See also
_REMOVE_GRAVITY_WELLRemoves gravity well by handle returned from 0x4F5EBE70081E5A20
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.