RedM Natives

TASK_FOLLOW_TO_OFFSET_OF_ENTITY

Hash0x304AE42E357B8C7E
Runtime nameTaskFollowToOffsetOfEntity
NamespaceTASK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x304AE42E357B8C7E

Signature

void TASK_FOLLOW_TO_OFFSET_OF_ENTITY(Ped ped, Entity entity, float offsetX, float offsetY, float offsetZ, float movementSpeed, int timeout, float stoppingRange, BOOL persistFollowing, BOOL p9, BOOL walkOnly, BOOL p11, BOOL p12, BOOL p13);

Parameters

NameTypeDescription
pedPed—
entityEntity—
offsetXfloat—
offsetYfloat—
offsetZfloat—
movementSpeedfloat—
timeoutint—
stoppingRangefloat—
persistFollowingBOOL—
p9BOOL—
walkOnlyBOOL—
p11BOOL—
p12BOOL—
p13BOOL—

Returns void

Description

femga rdr3_discoveries · research notes

0x304AE42E357B8C7E  (by Jonaskii)

TASK_FOLLOW_TO_OFFSET_OF_ENTITY(Ped follower, Ped target, float offsetX, float offsetY, float offsetZ, float var1, float var2, float minDist, BOOL b1, BOOL b2, BOOL walkOnly, BOOL b3, BOOL b4)

follower - The ped you want to follow somebody
target - The ped you want the follow to follow
offsetX,Y,Z - Offset from target the follower will stand
minDist - Minimum distance the follower can be from the target (-1 for auto, 50f is max)
walkOnly - if true the follower can only walk

var1: found in scripts (-1, 1f, 1.2f, 2f, 2.5f )
var2: found in scripts (-1, 1.0)
Unsure what they both do, I cannot seem to find any difference when raising and lowering them. Maybe you need to have one of the Booleans active for them to take effect?

Usage

Lua
TaskFollowToOffsetOfEntity(ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13)

-- always works, by hash
Citizen.InvokeNative(0x304AE42E357B8C7E, ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13)
JavaScript and C#
JavaScript
TaskFollowToOffsetOfEntity(ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13);

// by hash
Citizen.invokeNative('0x304AE42E357B8C7E', ped, entity, offsetX + 0.0000001, offsetY + 0.0000001, offsetZ + 0.0000001, movementSpeed + 0.0000001, timeout, stoppingRange + 0.0000001, persistFollowing, p9, walkOnly, p11, p12, p13);
C#
Function.Call((Hash)0x304AE42E357B8C7E, ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13);
  • 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.

Sources

alloc8or RDR3 NativeDB · femga rdr3_discoveries

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