RedM Natives

TASK_START_SCENARIO_AT_POSITION

Hash0x4D1F61FC34AF3CD1
Runtime nameTaskStartScenarioAtPosition
NamespaceTASK
SideClient
NameOfficial
Docs
Since build1207

Signature

void TASK_START_SCENARIO_AT_POSITION(Ped ped, Hash scenarioHash, float x, float y, float z, float heading, int duration, BOOL sittingScenario, BOOL teleport, const char* p9, float p10, BOOL p11);

Parameters

NameTypeDescription
pedPed—
scenarioHashHash—
xfloat—
yfloat—
zfloat—
headingfloat—
durationint—
sittingScenarioBOOL—
teleportBOOL—
p9const char*—
p10float—
p11BOOL—

Returns void

Usage

Lua
TaskStartScenarioAtPosition(ped, scenarioHash, x, y, z, heading, duration, sittingScenario, teleport, p9, p10, p11)

-- always works, by hash
Citizen.InvokeNative(0x4D1F61FC34AF3CD1, ped, scenarioHash, x, y, z, heading, duration, sittingScenario, teleport, p9, p10, p11)
JavaScript and C#
JavaScript
TaskStartScenarioAtPosition(ped, scenarioHash, x, y, z, heading, duration, sittingScenario, teleport, p9, p10, p11);

// by hash
Citizen.invokeNative('0x4D1F61FC34AF3CD1', ped, scenarioHash, x + 0.0000001, y + 0.0000001, z + 0.0000001, heading + 0.0000001, duration, sittingScenario, teleport, p9, p10 + 0.0000001, p11);
C#
Function.Call((Hash)0x4D1F61FC34AF3CD1, ped, scenarioHash, x, y, z, heading, duration, sittingScenario, teleport, p9, p10, p11);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • 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

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