TasksClient

taskStartScenarioInPlace

TASK_START_SCENARIO_IN_PLACE0x142A02425FF02BD9

The GTA V native TASK_START_SCENARIO_IN_PLACE of the TASK namespace, as LS:MP client scripts call it: the global function taskStartScenarioInPlace, in JavaScript and in Lua.

SignatureJavaScript
taskStartScenarioInPlace(
  ped: Ped,
  scenarioName: string,
  unkDelay: number,
  playEnterAnim: boolean
): void
SignatureLua
taskStartScenarioInPlace(
  ped: Ped,
  scenarioName: string,
  unkDelay: integer,
  playEnterAnim: boolean
)

Usage

JavaScript
taskStartScenarioInPlace(ped, scenarioName, unkDelay, playEnterAnim);
Lua
taskStartScenarioInPlace(ped, scenarioName, unkDelay, playEnterAnim)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
scenarioNamestringstringstring
unkDelayintnumberinteger
playEnterAnimBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Plays a scenario on a Ped at their current location.

unkDelay - Usually 0 or -1, doesn't seem to have any effect. Might be a delay between sequences.
playEnterAnim - Plays the "Enter" anim if true, otherwise plays the "Exit" anim. Scenarios that don't have any "Enter" anims won't play if this is set to true.


From "am_hold_up.ysc.c4" at line 339:

taskStartScenarioInPlace(netToPed(l_8D._f4), sub_adf(), 0, 1);

I'm unsure of what the last two parameters are, however sub_adf() randomly returns 1 of 3 scenarios, those being:
WORLD_HUMAN_SMOKING
WORLD_HUMAN_HANG_OUT_STREET
WORLD_HUMAN_STAND_MOBILE

This makes sense, as these are what I commonly see when going by a liquor store.


List of scenarioNames: https://pastebin.com/6mrYTdQv

Also these:
WORLD_FISH_FLEE
DRIVE
WORLD_HUMAN_HIKER
WORLD_VEHICLE_ATTRACTOR
WORLD_VEHICLE_BICYCLE_MOUNTAIN
WORLD_VEHICLE_BIKE_OFF_ROAD_RACE
WORLD_VEHICLE_BIKER
WORLD_VEHICLE_CONSTRUCTION_PASSENGERS
WORLD_VEHICLE_CONSTRUCTION_SOLO
WORLD_VEHICLE_DRIVE_PASSENGERS
WORLD_VEHICLE_DRIVE_SOLO
WORLD_VEHICLE_EMPTY
WORLD_VEHICLE_PARK_PARALLEL
WORLD_VEHICLE_PARK_PERPENDICULAR_NOSE_IN
WORLD_VEHICLE_POLICE_BIKE
WORLD_VEHICLE_POLICE_CAR
WORLD_VEHICLE_POLICE_NEXT_TO_CAR
WORLD_VEHICLE_SALTON_DIRT_BIKE
WORLD_VEHICLE_TRUCK_LOGS

Full list of ped scenarios by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/scenariosCompact.json

Reference

Namespace
Tasks TASK
In the game
void TASK_START_SCENARIO_IN_PLACE(Ped ped, const char* scenarioName, int unkDelay, BOOL playEnterAnim)
Hash
0x142A02425FF02BD9

Open in the interactive natives reference