SixL client API / game/task / GameTaskMp
Interface: GameTaskMp
The task functions. A task is given to a ped, which carries it out on its own until it ends or is replaced.
Remarks
Getters are asynchronous: they return a Promise. A ped, vehicle or target is given as an entity object or as its handle. Angles (headings) are in degrees and positions in metres; durations are in milliseconds unless the parameter says otherwise. A hash argument (a scenario, a driving style, a firing pattern) is a number, or a name that is hashed to its 32-bit joaat. Some arguments the game requires and RAGE MP does not: they are documented per function, and SixL passes the game's neutral value for them.
Example
mp.game.task.taskClearLookAt(ped);
Methods
achieveHeading()
achieveHeading(ped,heading,timeout):void
The same as taskAchieveHeading.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
heading
number
The heading in degrees.
timeout
number
The time in milliseconds the ped has to turn.
Returns
void
Example
mp.game.task.achieveHeading(ped, 90, 2000);
arrestPed()
arrestPed(ped,target):void
Makes a ped arrest another ped.
Parameters
ped
number | { handle: number; }
The arresting ped, or its handle.
target
number | { handle: number; }
The ped to arrest, or its handle.
Returns
void
Example
mp.game.task.arrestPed(officer, suspect);
clearDefensiveArea()
clearDefensiveArea(p0):void
Clears the defensive area of a ped set by the game's task.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.clearDefensiveArea(ped);
clearLookAt()
clearLookAt(ped):void
The same as taskClearLookAt.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.clearLookAt(ped);
clearPedSecondaryTask()
clearPedSecondaryTask(ped):void
Clears the secondary task of a ped (a task that runs alongside its main task, such as a look-at).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.clearPedSecondaryTask(ped);
clearPedTasksImmediately()
clearPedTasksImmediately(ped):void
Clears all the tasks of a ped at once.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.clearPedTasksImmediately(ped);
climb()
climb(ped,unused):void
The same as taskClimb.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
Returns
void
Example
mp.game.task.climb(ped, true);
cower()
cower(ped,duration):void
The same as taskCower.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The time in milliseconds.
Returns
void
Example
mp.game.task.cower(ped, 3000);
enterVehicle()
enterVehicle(ped,vehicle,timeout,seat,speed,flag,p6?):void
The same as taskEnterVehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
timeout
number
The time in milliseconds the ped has to get in.
seat
number
The seat to enter, as an integer (-1 for the driver).
speed
number
The speed of the move, as a float.
flag
number
A flag of the game, as an integer.
p6?
number
Not used by SixL: accepted for compatibility.
Returns
void
Example
mp.game.task.enterVehicle(ped, vehicle, 10000, -1, 1.0, 1, 0);
everyoneLeaveVehicle()
everyoneLeaveVehicle(vehicle):void
Makes everyone in a vehicle leave it.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
void
Example
mp.game.task.everyoneLeaveVehicle(vehicle);
followToOffsetOfEntity()
followToOffsetOfEntity(ped,entity,offsetX,offsetY,offsetZ,movementSpeed,timeout,stoppingRange,persistFollowing):void
Makes a ped follow an entity, keeping an offset from it.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
entity
number | { handle: number; }
The entity to follow, or its handle.
offsetX
number
The offset along the entity's X axis, in metres.
offsetY
number
The offset along the entity's Y axis, in metres.
offsetZ
number
The offset along the entity's Z axis, in metres.
movementSpeed
number
The speed, as a float (the game's move speed).
timeout
number
The time in milliseconds the task runs; -1 for no limit.
stoppingRange
number
The distance in metres at which the ped stops.
persistFollowing
boolean
Whether the ped keeps following once it is there.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.followToOffsetOfEntity(ped, other, 0, -2, 0, 1.0, -1, 1.0, true);
forceMotionState()
forceMotionState(ped,state,p2):void
The same as taskForceMotionState.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
state
string | number
The motion state's hash, or its name.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.forceMotionState(ped, 'MotionState_Idle', false);
getActiveVehicleMissionType()
getActiveVehicleMissionType(vehicle):Promise<number>
The mission type a vehicle carries out (what its driver is doing with it).
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
Promise<number>
A Promise of the mission type as an integer, the game's own values.
Example
const mission = await mp.game.task.getActiveVehicleMissionType(vehicle);
getIsTaskActive()
getIsTaskActive(ped,taskIndex):Promise<boolean>
Whether a task is active on a ped.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
taskIndex
number
The task's index, as an integer.
Returns
Promise<boolean>
A Promise of true while the task runs.
Example
const active = await mp.game.task.getIsTaskActive(ped, 0);
getNavmeshRouteDistanceRemaining()
getNavmeshRouteDistanceRemaining(ped):Promise<{distanceRemaining:number;isPathReady:boolean;result:number; }>
The distance a ped still has to walk along its navigation-mesh route.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<{ distanceRemaining: number; isPathReady: boolean; result: number; }>
A Promise of { result, distanceRemaining, isPathReady }: result the game's integer answer, distanceRemaining the distance in metres, isPathReady true once the route is computed.
Example
const { distanceRemaining, isPathReady } = await mp.game.task.getNavmeshRouteDistanceRemaining(ped);
getNavmeshRouteResult()
getNavmeshRouteResult(ped):Promise<number>
The result of a ped's navigation-mesh route.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<number>
A Promise of the route's result as an integer, the game's own values.
Example
const result = await mp.game.task.getNavmeshRouteResult(ped);
getPedDesiredMoveBlendRatio()
getPedDesiredMoveBlendRatio(ped):Promise<number>
The move blend ratio a ped aims for.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<number>
A Promise of the move blend ratio as a float.
Example
const ratio = await mp.game.task.getPedDesiredMoveBlendRatio(ped);
getPedWaypointProgress()
getPedWaypointProgress(ped):Promise<number>
The progress of a ped's waypoint playback (the recorded path it follows).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<number>
A Promise of the progress as an integer.
Example
const progress = await mp.game.task.getPedWaypointProgress(ped);
getScriptedCoverPointCoords()
getScriptedCoverPointCoords(coverpoint):Promise<IVector3>
The position of a scripted cover point.
Parameters
coverpoint
number
The cover point's id, as an integer.
Returns
Promise<IVector3>
A Promise of the position as { x, y, z } in metres.
Example
const { x, y, z } = await mp.game.task.getScriptedCoverPointCoords(coverPointId);
getScriptTaskStatus()
getScriptTaskStatus(ped,taskHash):Promise<number>
The status of a script task of a ped.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
taskHash
string | number
The task's hash, or its name.
Returns
Promise<number>
A Promise of the status as an integer, the game's own values.
Example
const status = await mp.game.task.getScriptTaskStatus(ped, mp.joaat('<task name>'));
getSequenceProgress()
getSequenceProgress(ped):Promise<number>
The progress of a ped's task sequence.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<number>
A Promise of the progress as an integer.
Example
const progress = await mp.game.task.getSequenceProgress(ped);
getVehicleWaypointProgress()
getVehicleWaypointProgress(vehicle):Promise<number>
The progress of a vehicle's waypoint playback.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
Promise<number>
A Promise of the progress as an integer.
Example
const progress = await mp.game.task.getVehicleWaypointProgress(vehicle);
getVehicleWaypointTargetPoint()
getVehicleWaypointTargetPoint(vehicle):Promise<number>
The target point of a vehicle's waypoint playback.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
Promise<number>
A Promise of the target point as an integer.
Example
const target = await mp.game.task.getVehicleWaypointTargetPoint(vehicle);
goStraightToCoordRelativeToEntity()
goStraightToCoordRelativeToEntity(entity1,entity2,x,y,z,moveBlendRatio,time):void
Makes a ped walk straight to a point, given relative to an entity.
Parameters
entity1
number | { handle: number; }
The ped, or its handle.
entity2
number | { handle: number; }
The entity the point is relative to, or its handle.
x
number
The point's X coordinate, in metres, relative to entity2.
y
number
The point's Y coordinate, in metres, relative to entity2.
z
number
The point's Z coordinate, in metres, relative to entity2.
moveBlendRatio
number
The move blend ratio, as a float.
time
number
The time in milliseconds the walk may take.
Returns
void
Example
mp.game.task.goStraightToCoordRelativeToEntity(ped, vehicle, 0, 5, 0, 2.0, 5000);
goToCoordAnyMeans()
goToCoordAnyMeans(ped,x,y,z,speed,p5,p6,walkingStyle,p8):void
Makes a ped walk or run to a point, by any means.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The destination's X coordinate, in metres.
y
number
The destination's Y coordinate, in metres.
z
number
The destination's Z coordinate, in metres.
speed
number
The speed, as a float (the game's move speed).
p5
number | { handle: number; }
An entity the move uses, or its handle; null when none.
p6
boolean
A flag of the game, a bool.
walkingStyle
string | number
The walking style: a hash of the game's walking style, or its name.
p8
number
A flag of the game, a float.
Returns
void
Example
mp.game.task.goToCoordAnyMeans(ped, 0, 0, 70, 2.0, null, false, 'move_m@generic', 0.5);
goToCoordAnyMeansExtraParams()
goToCoordAnyMeansExtraParams(ped,x,y,z,speed,p5,p6,walkingStyle,p8,p9?,p10?,p11?,p12?):void
Makes a ped walk or run to a point, by any means, with four more parameters of the game.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The destination's X coordinate, in metres.
y
number
The destination's Y coordinate, in metres.
z
number
The destination's Z coordinate, in metres.
speed
number
The speed, as a float (the game's move speed).
p5
number | { handle: number; }
An entity the move uses, or its handle; 0 or null when none.
p6
boolean
A flag of the game, a bool.
walkingStyle
string | number
The walking style: a hash of the game's walking style, or its name.
p8
number
A value of the game, a float.
p9?
number
A value of the game, a float.
p10?
number
A value of the game, a float.
p11?
number
A value of the game, an integer.
p12?
number
A value of the game, a float.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.goToCoordAnyMeansExtraParams(ped, 0, 0, 70, 2.0, 0, false, 0, 0.5, 0, 0, 0, 0);
goToEntity()
goToEntity(entity,target,duration,distance,speed,p5?,p6?):void
Makes a ped go to an entity, with a move speed and a slow-down distance.
Parameters
entity
number | { handle: number; }
The ped, or its handle.
target
number | { handle: number; }
The entity to go to, or its handle.
duration
number
The time in milliseconds the move may take.
distance
number
The distance at which the ped slows down, in metres.
speed
number
The move blend ratio, as a float.
p5?
number
Not used by SixL: accepted for compatibility.
p6?
number
Not used by SixL: accepted for compatibility.
Returns
void
Example
mp.game.task.goToEntity(ped, vehicle, 10000, 5, 2.0);
guardAssignedDefensiveArea()
guardAssignedDefensiveArea(p0,x,y,z,heading,maxPatrolProximity,timer):void
Makes a ped guard its assigned defensive area.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
x
number
The area's centre X coordinate, in metres.
y
number
The area's centre Y coordinate, in metres.
z
number
The area's centre Z coordinate, in metres.
heading
number
The heading to guard, in degrees.
maxPatrolProximity
number
The largest distance a patrol may go from the area, in metres.
timer
number
The time in milliseconds to guard.
Returns
void
Example
mp.game.task.guardAssignedDefensiveArea(ped, 0, 0, 70, 90, 10, 60000);
guardCurrentPosition()
guardCurrentPosition(p0,p1,p2,p3):void
The same as taskGuardCurrentPosition.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number
A radius-like value of the game, as a float.
p2
number
A radius-like value of the game, as a float.
p3
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.guardCurrentPosition(ped, 10, 10, true);
handsUp()
handsUp(ped,duration,facingPed,p3,p4):void
The same as taskHandsUp.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The time in milliseconds the hands stay up.
facingPed
number | { handle: number; }
The ped to face, or its handle.
p3
number
A flag of the game, as an integer.
p4
number | boolean
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.handsUp(ped, 5000, other, 0, 0);
heliChase()
heliChase(pilot,entityToFollow,x,y,z):void
The same as taskHeliChase.
Parameters
pilot
number | { handle: number; }
The pilot, or its handle.
entityToFollow
number | { handle: number; }
The entity to follow, or its handle.
x
number
The offset's X coordinate, in metres.
y
number
The offset's Y coordinate, in metres.
z
number
The offset's Z coordinate, in metres.
Returns
void
Example
mp.game.task.heliChase(pilot, target, 0, 0, 30);
isMoveBlendRatioRunning()
isMoveBlendRatioRunning(moveBlendRatio):Promise<boolean>
Whether a move blend ratio is a run.
Parameters
moveBlendRatio
number
The move blend ratio, as a float.
Returns
Promise<boolean>
A Promise of true when the ratio is a run.
Example
const running = await mp.game.task.isMoveBlendRatioRunning(2.0);
isMoveBlendRatioSprinting()
isMoveBlendRatioSprinting(moveBlendRatio):Promise<boolean>
Whether a move blend ratio means that a ped is sprinting.
Parameters
moveBlendRatio
number
The move blend ratio, as a float.
Returns
Promise<boolean>
A Promise of true when the ratio is a sprint.
Example
const sprinting = await mp.game.task.isMoveBlendRatioSprinting(3.0);
isMoveNetworkActive()
isMoveNetworkActive(ped):Promise<boolean>
Tells whether a ped has an active move network, the animation state machine that tasks use.
Parameters
ped
number | { handle: number; }
The ped, its handle or an object with a handle.
Returns
Promise<boolean>
A Promise of true while the move network is active.
Example
const active = await mp.game.task.isMoveNetworkActive(ped);
isPedActiveInScenario()
isPedActiveInScenario(ped):Promise<boolean>
Whether a ped is active in a scenario.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped is in a scenario.
Example
const active = await mp.game.task.isPedActiveInScenario(ped, false);
isPedBeingArrested()
isPedBeingArrested(ped):Promise<boolean>
Whether a ped is being arrested.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped is being arrested.
Example
const arrested = await mp.game.task.isPedBeingArrested(ped);
isPedCuffed()
isPedCuffed(ped):Promise<boolean>
Whether a ped is handcuffed.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped is cuffed.
Example
const cuffed = await mp.game.task.isPedCuffed(ped);
isPedGettingUp()
isPedGettingUp(ped):Promise<boolean>
Whether a ped is getting up (after a ragdoll or a knock-down).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped gets up.
Example
const up = await mp.game.task.isPedGettingUp(ped);
isPedInWrithe()
isPedInWrithe(ped):Promise<boolean>
Whether a ped is writhing (on the ground, injured).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped writhes.
Example
const writhing = await mp.game.task.isPedInWrithe(ped);
isPedRunning()
isPedRunning(ped):Promise<boolean>
Whether a ped runs.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped runs.
Example
const running = await mp.game.task.isPedRunning(ped);
isPedSprinting()
isPedSprinting(ped):Promise<boolean>
Whether a ped sprints.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped sprints.
Example
const sprinting = await mp.game.task.isPedSprinting(ped);
isPedStill()
isPedStill(ped):Promise<boolean>
Whether a ped stands still.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped is still.
Example
const still = await mp.game.task.isPedStill(ped);
isPedStrafing()
isPedStrafing(ped):Promise<boolean>
Whether a ped strafes (moves sideways while facing a target).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped strafes.
Example
const strafing = await mp.game.task.isPedStrafing(ped);
isPedWalking()
isPedWalking(ped):Promise<boolean>
Whether a ped walks.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped walks.
Example
const walking = await mp.game.task.isPedWalking(ped);
isWaypointPlaybackGoingOnForPed()
isWaypointPlaybackGoingOnForPed(p0):Promise<boolean>
Whether a ped follows a waypoint playback (the recorded path).
Parameters
p0
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the ped follows a waypoint path.
Example
const following = await mp.game.task.isWaypointPlaybackGoingOnForPed(ped);
isWaypointPlaybackGoingOnForVehicle()
isWaypointPlaybackGoingOnForVehicle(vehicle):Promise<boolean>
Whether a waypoint playback is running for a vehicle.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
Promise<boolean>
A Promise of true while the vehicle follows a waypoint path.
Example
const running = await mp.game.task.isWaypointPlaybackGoingOnForVehicle(vehicle);
jump()
jump(ped,unused,p2?,p3?):void
The same as taskJump.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
p2?
number
Not used by SixL: accepted for compatibility.
p3?
number
Not used by SixL: accepted for compatibility.
Returns
void
Example
mp.game.task.jump(ped, true);
leaveAnyVehicle()
leaveAnyVehicle(ped,p1,flags):void
The same as taskLeaveAnyVehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A flag of the game, as an integer.
flags
number
The flags of the exit, as an integer bit mask.
Returns
void
Example
mp.game.task.leaveAnyVehicle(ped, 0, 0);
leaveVehicle()
leaveVehicle(ped,vehicle,flags):void
The same as taskLeaveVehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
flags
number
The flags of the exit, as an integer bit mask.
Returns
void
Example
mp.game.task.leaveVehicle(ped, vehicle, 0);
openVehicleDoor()
openVehicleDoor(ped,vehicle,timeOut,seat,speed):void
The same as taskOpenVehicleDoor.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
timeOut
number
The time in milliseconds the ped has to open the door.
seat
number
The seat whose door opens, as an integer.
speed
number
The speed of the opening, as a float.
Returns
void
Example
mp.game.task.openVehicleDoor(ped, vehicle, 5000, 0, 1.0);
parachute()
parachute(ped,p1,p2):void
The same as taskParachute.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
boolean
A flag of the game, a bool.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.parachute(ped, false, false);
pause()
pause(ped,ms):void
The same as taskPause.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
ms
number
The time in milliseconds.
Returns
void
Example
mp.game.task.pause(ped, 2000);
pedHasUseScenarioTask()
pedHasUseScenarioTask(ped):Promise<boolean>
Whether a ped has a scenario task.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
Promise<boolean>
A Promise of true when the ped has a use-scenario task.
Example
const has = await mp.game.task.pedHasUseScenarioTask(ped);
performSequence()
performSequence(ped,taskSequenceId):void
The same as taskPerformSequence.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
taskSequenceId
number
The sequence's id, as an integer.
Returns
void
Example
mp.game.task.performSequence(ped, sequenceId);
performSequenceFromProgress()
performSequenceFromProgress(p0,p1,p2,p3):void
Carries on a task sequence from a given progress.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number
The sequence's id, as an integer.
p2
number
The progress, as an integer.
p3
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.performSequenceFromProgress(ped, sequenceId, 0, 0);
rappelFromHeli()
rappelFromHeli(ped,p1):void
The same as taskRappelFromHeli.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A height-like value of the game, as a float.
Returns
void
Example
mp.game.task.rappelFromHeli(ped, 10);
reloadWeapon()
reloadWeapon(ped,unused):void
The same as taskReloadWeapon.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
Returns
void
Example
mp.game.task.reloadWeapon(ped, true);
removeCoverPoint()
removeCoverPoint(coverpoint):void
Removes a cover point.
Parameters
coverpoint
number
The cover point's id, as an integer.
Returns
void
Example
mp.game.task.removeCoverPoint(coverPointId);
setBlockingOfNonTemporaryEvents()
setBlockingOfNonTemporaryEvents(ped,toggle):void
The same as taskSetBlockingOfNonTemporaryEvents.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
toggle
boolean
true to block such events, false to let them through.
Returns
void
Example
mp.game.task.setBlockingOfNonTemporaryEvents(ped, true);
setDriveTaskCruiseSpeed()
setDriveTaskCruiseSpeed(driver,cruiseSpeed):void
Sets the cruise speed a driver aims for.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
cruiseSpeed
number
The speed in metres per second.
Returns
void
Example
mp.game.task.setDriveTaskCruiseSpeed(driver, 15);
setDriveTaskDrivingStyle()
setDriveTaskDrivingStyle(ped,drivingStyle):void
Sets the driving style of a driver.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
drivingStyle
string | number
The driving style: an integer flag of the game, or a hash.
Returns
void
Example
mp.game.task.setDriveTaskDrivingStyle(driver, 786603);
setMountedWeaponTarget()
setMountedWeaponTarget(shootingPed,targetPed,targetVehicle,x,y,z,p6,p7):void
Points a ped's mounted weapon at a target or a place.
Parameters
shootingPed
number | { handle: number; }
The ped, or its handle.
targetPed
number | { handle: number; }
The target ped, or its handle (0 for none).
targetVehicle
number | { handle: number; }
The target vehicle, or its handle (0 for none).
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
p6
number
Not used.
p7
number
Not used.
Returns
void
Remarks
Partial: not yet confirmed in the game. p6 and p7 have no place in VI: dropped.
Example
mp.game.task.setMountedWeaponTarget(ped, target, 0, 0, 0, 0);
setPedDesiredMoveBlendRatio()
setPedDesiredMoveBlendRatio(ped,p1):void
Sets the move blend ratio a ped aims for.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
The move blend ratio, as a float.
Returns
void
Example
mp.game.task.setPedDesiredMoveBlendRatio(ped, 2.0);
setSequenceToRepeat()
setSequenceToRepeat(taskSequenceId,repeat):void
Sets a task sequence to repeat (run again when it ends).
Parameters
taskSequenceId
number
The sequence's id, as an integer.
repeat
boolean
true to repeat the sequence, false to run it once.
Returns
void
Example
mp.game.task.setSequenceToRepeat(sequenceId, true);
setSphereDefensiveArea()
setSphereDefensiveArea(p0,x,y,z,radius):void
Sets a spherical defensive area for a ped, set by the game's task (the ped stays in it).
Parameters
p0
number | { handle: number; }
The ped, or its handle.
x
number
The centre's X coordinate, in metres.
y
number
The centre's Y coordinate, in metres.
z
number
The centre's Z coordinate, in metres.
radius
number
The sphere's radius, in metres.
Returns
void
Example
mp.game.task.setSphereDefensiveArea(ped, 0, 0, 70, 10);
setTaskVehicleChaseBehaviorFlag()
setTaskVehicleChaseBehaviorFlag(ped,flag,set):void
Sets a behaviour flag of a vehicle chase.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
flag
number
The flag, as an integer of the game's own values.
set
boolean
true to set the flag, false to clear it.
Returns
void
Example
mp.game.task.setTaskVehicleChaseBehaviorFlag(driver, 1, true);
setTaskVehicleChaseIdealPursuitDistance()
setTaskVehicleChaseIdealPursuitDistance(ped,distance):void
Sets the distance a vehicle chase keeps to its target.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
distance
number
The distance in metres.
Returns
void
Example
mp.game.task.setTaskVehicleChaseIdealPursuitDistance(driver, 20);
setVehicleChaseBehaviorFlag()
setVehicleChaseBehaviorFlag(ped,flag,set):void
The same as setTaskVehicleChaseBehaviorFlag.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
flag
number
The flag, as an integer of the game's own values.
set
boolean
true to set the flag, false to clear it.
Returns
void
Example
mp.game.task.setVehicleChaseBehaviorFlag(driver, 1, true);
setVehicleChaseIdealPursuitDistance()
setVehicleChaseIdealPursuitDistance(ped,distance):void
The same as setTaskVehicleChaseIdealPursuitDistance.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
distance
number
The distance in metres.
Returns
void
Example
mp.game.task.setVehicleChaseIdealPursuitDistance(driver, 20);
shockingEventReact()
shockingEventReact(ped,eventHandle):void
The same as taskShockingEventReact.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
eventHandle
number
The event's handle, as an integer.
Returns
void
Example
mp.game.task.shockingEventReact(ped, eventHandle);
shuffleToNextVehicleSeat()
shuffleToNextVehicleSeat(ped,vehicle,p2):void
The same as taskShuffleToNextVehicleSeat.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
p2
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.shuffleToNextVehicleSeat(ped, vehicle, 0);
skyDive()
skyDive(ped,p1):void
The same as taskSkyDive.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.skyDive(ped, false);
standStill()
standStill(ped,time):void
The same as taskStandStill.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
time
number
The time in milliseconds the ped stands still.
Returns
void
Example
mp.game.task.standStill(ped, 5000);
stopAnimPlayback()
stopAnimPlayback(ped,p1,p2):void
Stops the animation playback of a ped.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A flag of the game, as an integer.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.stopAnimPlayback(ped, 0, false);
taskAchieveHeading()
taskAchieveHeading(ped,heading,timeout):void
Turns a ped to a heading.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
heading
number
The heading in degrees.
timeout
number
The time in milliseconds the ped has to turn.
Returns
void
Example
mp.game.task.taskAchieveHeading(ped, 90, 2000);
taskBoatMission()
taskBoatMission(pedDriver,boat,p2,p3,x,y,z,p7,maxSpeed,drivingStyle,p10,p11):void
Gives a ped, driving a boat, a mission.
Parameters
pedDriver
number | { handle: number; }
The driver, or its handle.
boat
number | { handle: number; }
The boat, or its handle.
p2
number | { handle: number; }
A target vehicle, or its handle (0 for none).
p3
number | { handle: number; }
A target ped, or its handle (0 for none).
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
p7
number
The mission, as the game numbers it.
maxSpeed
number
The speed.
drivingStyle
number
The driving style flags.
p10
number
Passed to the game as it is.
p11
number
Passed to the game as it is.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.taskBoatMission(ped, boat, 0, 0, x, y, z, 4, 20, 786603, -1, 0);
taskClearLookAt()
taskClearLookAt(ped):void
Clears the look-at target of a ped, so it looks where it normally looks.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.taskClearLookAt(ped);
taskClimb()
taskClimb(ped,unused):void
Makes a ped climb an obstacle in front of it.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
Returns
void
Example
mp.game.task.taskClimb(ped, true);
taskCower()
taskCower(ped,duration):void
Makes a ped cower (crouch and cover its head) for a time.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The time in milliseconds.
Returns
void
Example
mp.game.task.taskCower(ped, 3000);
taskDriveBy()
taskDriveBy(driverPed,targetPed,targetVehicle,targetX,targetY,targetZ,distanceToShoot,pedAccuracy,p8,firingPattern):void
Makes a ped shoot from a vehicle at a target or a place.
Parameters
driverPed
number | { handle: number; }
The ped, or its handle.
targetPed
number | { handle: number; }
The target ped, or its handle (0 for none).
targetVehicle
number | { handle: number; }
The target vehicle, or its handle (0 for none).
targetX
number
The place X.
targetY
number
The place Y.
targetZ
number
The place Z.
distanceToShoot
number
The distance to shoot from.
pedAccuracy
number
The accuracy.
p8
boolean
Passed to the game as it is.
firingPattern
number
The firing pattern, a VI key.
Returns
void
Remarks
Partial: not yet confirmed in the game. The firing pattern is a VI key.
Example
mp.game.task.taskDriveBy(ped, target, 0, 0, 0, 0, 50, 100, false, pattern);
taskEnterVehicle()
taskEnterVehicle(ped,vehicle,timeout,seat,speed,flag,p6?):void
Makes a ped enter a vehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
timeout
number
The time in milliseconds the ped has to get in.
seat
number
The seat to enter, as an integer (-1 for the driver).
speed
number
The speed of the move, as a float.
flag
number
A flag of the game, as an integer.
p6?
number
Not used by SixL: accepted for compatibility.
Returns
void
Example
mp.game.task.taskEnterVehicle(ped, vehicle, 10000, -1, 1.0, 1, 0);
taskForceMotionState()
taskForceMotionState(ped,state,p2):void
Forces a ped into a motion state.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
state
string | number
The motion state's hash, or its name.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.taskForceMotionState(ped, 'MotionState_Idle', false);
taskGoToCoordAnyMeansExtraParams()
taskGoToCoordAnyMeansExtraParams(ped,x,y,z,speed,p5,p6,walkingStyle,p8,p9?,p10?,p11?,p12?):void
The same as goToCoordAnyMeansExtraParams.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The destination's X coordinate, in metres.
y
number
The destination's Y coordinate, in metres.
z
number
The destination's Z coordinate, in metres.
speed
number
The speed, as a float (the game's move speed).
p5
number | { handle: number; }
An entity the move uses, or its handle; 0 or null when none.
p6
boolean
A flag of the game, a bool.
walkingStyle
string | number
The walking style: a hash of the game's walking style, or its name.
p8
number
A value of the game, a float.
p9?
number
A value of the game, a float.
p10?
number
A value of the game, a float.
p11?
number
A value of the game, an integer.
p12?
number
A value of the game, a float.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.taskGoToCoordAnyMeansExtraParams(ped, 0, 0, 70, 2.0, 0, false, 0, 0.5, 0, 0, 0, 0);
taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed()
taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed(ped,x,y,z,speed,p5,p6,walkingStyle,p8,p9,p10,p11,p12,p13):void
Makes a ped go to a place by any means, with extra settings and a cruise speed.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
speed
number
The speed.
p5
number | { handle: number; }
A vehicle, or its handle (0 for none).
p6
boolean
Passed to the game as it is.
walkingStyle
number
The walking style, a VI key.
p8
number
Passed to the game as it is.
p9
number
Passed to the game as it is.
p10
number
Passed to the game as it is.
p11
number
Passed to the game as it is.
p12
number
Passed to the game as it is.
p13
number
Passed to the game as it is.
Returns
void
Remarks
Partial: not yet confirmed in the game. The walking style is a VI key.
Example
mp.game.task.taskGoToCoordAnyMeansExtraParamsWithCruiseSpeed(ped, x, y, z, 2, 0, false, 0, -1, 0, 0, 0, 0, 0);
taskGuardCurrentPosition()
taskGuardCurrentPosition(p0,p1,p2,p3):void
Makes a ped guard its current position.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number
A radius-like value of the game, as a float.
p2
number
A radius-like value of the game, as a float.
p3
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.taskGuardCurrentPosition(ped, 10, 10, true);
taskHandsUp()
taskHandsUp(ped,duration,facingPed,p3,p4):void
Makes a ped raise its hands, facing another ped.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The time in milliseconds the hands stay up.
facingPed
number | { handle: number; }
The ped to face, or its handle.
p3
number
A flag of the game, as an integer.
p4
number | boolean
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.taskHandsUp(ped, 5000, other, 0, 0);
taskHeliChase()
taskHeliChase(pilot,entityToFollow,x,y,z):void
Makes a helicopter pilot chase an entity, to a point near it.
Parameters
pilot
number | { handle: number; }
The pilot, or its handle.
entityToFollow
number | { handle: number; }
The entity to follow, or its handle.
x
number
The offset's X coordinate, in metres.
y
number
The offset's Y coordinate, in metres.
z
number
The offset's Z coordinate, in metres.
Returns
void
Example
mp.game.task.taskHeliChase(pilot, target, 0, 0, 30);
taskJump()
taskJump(ped,unused,p2?,p3?):void
Makes a ped jump.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
p2?
number
Not used by SixL: accepted for compatibility.
p3?
number
Not used by SixL: accepted for compatibility.
Returns
void
Example
mp.game.task.taskJump(ped, true);
taskLeaveAnyVehicle()
taskLeaveAnyVehicle(ped,p1,flags):void
Makes a ped leave any vehicle it is in.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A flag of the game, as an integer.
flags
number
The flags of the exit, as an integer bit mask.
Returns
void
Example
mp.game.task.taskLeaveAnyVehicle(ped, 0, 0);
taskLeaveVehicle()
taskLeaveVehicle(ped,vehicle,flags):void
Makes a ped leave a vehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
flags
number
The flags of the exit, as an integer bit mask.
Returns
void
Example
mp.game.task.taskLeaveVehicle(ped, vehicle, 0);
taskOpenVehicleDoor()
taskOpenVehicleDoor(ped,vehicle,timeOut,seat,speed):void
Makes a ped open a vehicle's door.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
timeOut
number
The time in milliseconds the ped has to open the door.
seat
number
The seat whose door opens, as an integer.
speed
number
The speed of the opening, as a float.
Returns
void
Example
mp.game.task.taskOpenVehicleDoor(ped, vehicle, 5000, 0, 1.0);
taskParachute()
taskParachute(ped,p1,p2):void
Makes a ped open a parachute.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
boolean
A flag of the game, a bool.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.taskParachute(ped, false, false);
taskPause()
taskPause(ped,ms):void
Makes a ped stand still for a time.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
ms
number
The time in milliseconds.
Returns
void
Example
mp.game.task.taskPause(ped, 2000);
taskPerformSequence()
taskPerformSequence(ped,taskSequenceId):void
Makes a ped carry out a task sequence (a list of tasks the game runs one after another).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
taskSequenceId
number
The sequence's id, as an integer.
Returns
void
Example
mp.game.task.taskPerformSequence(ped, sequenceId);
taskRappelFromHeli()
taskRappelFromHeli(ped,p1):void
Makes a ped rappel from a helicopter.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A height-like value of the game, as a float.
Returns
void
Example
mp.game.task.taskRappelFromHeli(ped, 10);
taskReloadWeapon()
taskReloadWeapon(ped,unused):void
Makes a ped reload its weapon.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
unused
boolean
A flag the game takes (RAGE MP names it unused).
Returns
void
Example
mp.game.task.taskReloadWeapon(ped, true);
taskSetBlockingOfNonTemporaryEvents()
taskSetBlockingOfNonTemporaryEvents(ped,toggle):void
Sets whether a ped blocks its non-temporary events (events that change its long-term behaviour).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
toggle
boolean
true to block such events, false to let them through.
Returns
void
Example
mp.game.task.taskSetBlockingOfNonTemporaryEvents(ped, true);
taskShockingEventReact()
taskShockingEventReact(ped,eventHandle):void
Makes a ped react to a shocking event (one it has seen or heard).
Parameters
ped
number | { handle: number; }
The ped, or its handle.
eventHandle
number
The event's handle, as an integer.
Returns
void
Example
mp.game.task.taskShockingEventReact(ped, eventHandle);
taskShuffleToNextVehicleSeat()
taskShuffleToNextVehicleSeat(ped,vehicle,p2):void
Makes a ped move to the next free seat of a vehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
p2
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.taskShuffleToNextVehicleSeat(ped, vehicle, 0);
taskSkyDive()
taskSkyDive(ped,p1):void
Makes a ped skydive from a plane.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.taskSkyDive(ped, false);
taskStandStill()
taskStandStill(ped,time):void
Makes a ped stand still.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
time
number
The time in milliseconds the ped stands still.
Returns
void
Example
mp.game.task.taskStandStill(ped, 5000);
taskStartScenarioAtPosition()
taskStartScenarioAtPosition(ped,scenarioName,x,y,z,heading,duration,sittingScenario,teleport):void
Makes a ped play a scenario at a place.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
scenarioName
string
The scenario, by name.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
heading
number
The heading.
duration
number
How long, in milliseconds (-1: until stopped).
sittingScenario
boolean
Whether it is a sitting one.
teleport
boolean
Whether the ped is put there at once.
Returns
void
Remarks
Partial: not yet confirmed in the game. The scenario is VI's: its name is hashed to the key VI takes.
Example
mp.game.task.taskStartScenarioAtPosition(ped, scenario, x, y, z, 0, -1, false, true);
taskUseNearestScenarioToCoord()
taskUseNearestScenarioToCoord(ped,x,y,z,distance,duration):void
Makes a ped use the nearest scenario (an idle activity) to a point.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
distance
number
The search distance, in metres.
duration
number
The time in milliseconds to use the scenario.
Returns
void
Example
mp.game.task.taskUseNearestScenarioToCoord(ped, 0, 0, 70, 20, -1);
taskUseNearestScenarioToCoordWarp()
taskUseNearestScenarioToCoordWarp(ped,x,y,z,radius,p5):void
Makes a ped use the nearest scenario to a point, moving it there first.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
radius
number
The search radius, in metres.
p5
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.taskUseNearestScenarioToCoordWarp(ped, 0, 0, 70, 20, 0);
taskVehicleChase()
taskVehicleChase(driver,targetEnt):void
Makes a driver chase a target entity with a vehicle.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
targetEnt
number | { handle: number; }
The target, or its handle.
Returns
void
Example
mp.game.task.taskVehicleChase(driver, target);
taskVehicleDriveToCoord()
taskVehicleDriveToCoord(ped,vehicle,x,y,z,speed,p6,vehicleModel,drivingMode,stopRange,p10):void
Makes a ped drive a vehicle to a place.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
speed
number
The speed.
p6
number
Passed to the game as it is.
vehicleModel
number
The vehicle model, a VI key.
drivingMode
number
The driving style flags.
stopRange
number
The distance to stop at.
p10
number
Passed to the game as it is.
Returns
void
Remarks
Partial: not yet confirmed in the game. The model is a VI key.
Example
mp.game.task.taskVehicleDriveToCoord(ped, vehicle, x, y, z, 20, 1, model, 786603, 5, 0);
taskVehicleDriveWander()
taskVehicleDriveWander(ped,vehicle,speed,drivingStyle):void
Makes a driver wander with a vehicle at a speed.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
speed
number
The speed in metres per second.
drivingStyle
number
The driving style: an integer flag of the game, or a hash.
Returns
void
Example
mp.game.task.taskVehicleDriveWander(driver, vehicle, 15, 786603);
taskVehicleEscort()
taskVehicleEscort(ped,vehicle,targetVehicle,mode,speed,drivingStyle,minDistance,p7,noRoadsDistance):void
Makes a ped escort another vehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
targetVehicle
number | { handle: number; }
The vehicle escorted, or its handle.
mode
number
The mode.
speed
number
The speed.
drivingStyle
number
The driving style flags.
minDistance
number
The distance kept.
p7
number
Not used.
noRoadsDistance
number
Not used.
Returns
void
Remarks
Partial: not yet confirmed in the game. p7 and noRoadsDistance have no place in VI: dropped.
Example
mp.game.task.taskVehicleEscort(ped, vehicle, target, -1, 20, 786603, 5);
taskVehicleFollow()
taskVehicleFollow(driver,vehicle,targetEntity,speed,drivingStyle,minDistance):void
Makes a driver follow a target entity with a vehicle.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
targetEntity
number | { handle: number; }
The entity to follow, or its handle.
speed
number
The speed in metres per second.
drivingStyle
number
The driving style: an integer flag of the game, or a hash.
minDistance
number
The distance to keep, in metres.
Returns
void
Example
mp.game.task.taskVehicleFollow(driver, vehicle, target, 20, 786603, 10);
taskVehicleGotoNavmesh()
taskVehicleGotoNavmesh(ped,vehicle,x,y,z,speed,behaviorFlag,stoppingRange):void
Makes a ped drive a vehicle to a place along the navigation mesh.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
speed
number
The speed.
behaviorFlag
number
The flags.
stoppingRange
number
The distance to stop at.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.taskVehicleGotoNavmesh(ped, vehicle, x, y, z, 10, 156, 5);
taskVehicleMissionCoorsTarget()
taskVehicleMissionCoorsTarget(ped,vehicle,x,y,z,p5,p6,p7,p8,p9,DriveAgainstTraffic):void
Gives a ped, driving, a mission towards a place.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
p5
number
The mission, as the game numbers it.
p6
number
The cruise speed.
p7
number
The driving style flags.
p8
number
The distance at which it is reached.
p9
number
The straight-line distance.
DriveAgainstTraffic
boolean
Whether to drive against the traffic.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.taskVehicleMissionCoorsTarget(ped, vehicle, x, y, z, 4, 20, 786603, 5, 10, false);
taskVehiclePark()
taskVehiclePark(ped,vehicle,x,y,z,heading,mode,radius,keepEngineOn):void
Makes a ped park a vehicle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
x
number
The place X.
y
number
The place Y.
z
number
The place Z.
heading
number
The heading.
mode
number
The mode.
radius
number
The radius.
keepEngineOn
boolean
Whether the engine keeps running.
Returns
void
Remarks
Partial: not yet confirmed in the game.
Example
mp.game.task.taskVehiclePark(ped, vehicle, x, y, z, 90, 0, 20, false);
taskVehicleShootAtPed()
taskVehicleShootAtPed(ped,target,p2):void
Makes a driver's vehicle shoot at a ped.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
target
number | { handle: number; }
The ped to shoot at, or its handle.
p2
number
A flag of the game, a float.
Returns
void
Example
mp.game.task.taskVehicleShootAtPed(driver, target, 0);
taskVehicleTempAction()
taskVehicleTempAction(driver,vehicle,action,time):void
Makes a driver carry out a temporary action with a vehicle (such as reversing or hard braking) for a time.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
action
number
The action, as an integer of the game's own values.
time
number
The time in milliseconds.
Returns
void
Example
mp.game.task.taskVehicleTempAction(driver, vehicle, 1, 2000);
taskWanderInArea()
taskWanderInArea(ped,x,y,z,radius,minimalLength,timeBetweenWalks):void
Makes a ped wander at random inside a circle.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The circle's centre X coordinate, in metres.
y
number
The circle's centre Y coordinate, in metres.
z
number
The circle's centre Z coordinate, in metres.
radius
number
The circle's radius, in metres.
minimalLength
number
The minimum length of a walk, in metres.
timeBetweenWalks
number
The time between walks, in milliseconds.
Returns
void
Example
mp.game.task.taskWanderInArea(ped, 0, 0, 70, 20, 5, 1000);
taskWanderStandard()
taskWanderStandard(ped,p1,p2):void
Makes a ped wander on its own, with the game's standard wandering.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A flag of the game, a float.
p2
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.taskWanderStandard(ped, 10, 0);
turnPedToFaceCoord()
turnPedToFaceCoord(ped,x,y,z,duration):void
Turns a ped to face a point.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
duration
number
The time in milliseconds the turn takes.
Returns
void
Example
mp.game.task.turnPedToFaceCoord(ped, 0, 0, 70, 1000);
turnPedToFaceEntity()
turnPedToFaceEntity(ped,entity,duration):void
Turns a ped to face an entity.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
entity
number | { handle: number; }
The entity to face, or its handle.
duration
number
The time in milliseconds the turn takes.
Returns
void
Example
mp.game.task.turnPedToFaceEntity(ped, vehicle, 1000);
uncuffPed()
uncuffPed(ped):void
Uncuffs a ped.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
Returns
void
Example
mp.game.task.uncuffPed(ped);
updateHandsUpDuration()
updateHandsUpDuration(ped,duration):void
The same as updateTaskHandsUpDuration.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The new time in milliseconds.
Returns
void
Example
mp.game.task.updateHandsUpDuration(ped, 8000);
updateTaskHandsUpDuration()
updateTaskHandsUpDuration(ped,duration):void
Changes the duration of a ped's hands-up task that is running.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
duration
number
The new time in milliseconds.
Returns
void
Example
mp.game.task.updateTaskHandsUpDuration(ped, 8000);
useNearestScenarioToCoord()
useNearestScenarioToCoord(ped,x,y,z,distance,duration):void
The same as taskUseNearestScenarioToCoord.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
distance
number
The search distance, in metres.
duration
number
The time in milliseconds to use the scenario.
Returns
void
Example
mp.game.task.useNearestScenarioToCoord(ped, 0, 0, 70, 20, -1);
useNearestScenarioToCoordWarp()
useNearestScenarioToCoordWarp(ped,x,y,z,radius,p5):void
The same as taskUseNearestScenarioToCoordWarp.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
radius
number
The search radius, in metres.
p5
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.useNearestScenarioToCoordWarp(ped, 0, 0, 70, 20, 0);
vehicleAimAtCoord()
vehicleAimAtCoord(ped,x,y,z):void
Makes a driver's vehicle aim at a point.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
Returns
void
Example
mp.game.task.vehicleAimAtCoord(driver, 0, 0, 70);
vehicleAimAtPed()
vehicleAimAtPed(ped,target):void
Makes a driver's vehicle aim at a ped.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
target
number | { handle: number; }
The ped to aim at, or its handle.
Returns
void
Example
mp.game.task.vehicleAimAtPed(driver, target);
vehicleChase()
vehicleChase(driver,targetEnt):void
The same as taskVehicleChase.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
targetEnt
number | { handle: number; }
The target, or its handle.
Returns
void
Example
mp.game.task.vehicleChase(driver, target);
vehicleDriveWander()
vehicleDriveWander(ped,vehicle,speed,drivingStyle):void
The same as taskVehicleDriveWander.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
speed
number
The speed in metres per second.
drivingStyle
number
The driving style: an integer flag of the game, or a hash.
Returns
void
Example
mp.game.task.vehicleDriveWander(driver, vehicle, 15, 786603);
vehicleFollow()
vehicleFollow(driver,vehicle,targetEntity,speed,drivingStyle,minDistance):void
The same as taskVehicleFollow.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
targetEntity
number | { handle: number; }
The entity to follow, or its handle.
speed
number
The speed in metres per second.
drivingStyle
number
The driving style: an integer flag of the game, or a hash.
minDistance
number
The distance to keep, in metres.
Returns
void
Example
mp.game.task.vehicleFollow(driver, vehicle, target, 20, 786603, 10);
vehicleShootAtCoord()
vehicleShootAtCoord(ped,x,y,z,p4):void
Makes a driver's vehicle shoot at a point.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
p4
number
A flag of the game, a float.
Returns
void
Example
mp.game.task.vehicleShootAtCoord(driver, 0, 0, 70, 0);
vehicleShootAtPed()
vehicleShootAtPed(ped,target,p2):void
The same as taskVehicleShootAtPed.
Parameters
ped
number | { handle: number; }
The driver, or its handle.
target
number | { handle: number; }
The ped to shoot at, or its handle.
p2
number
A flag of the game, a float.
Returns
void
Example
mp.game.task.vehicleShootAtPed(driver, target, 0);
vehicleTempAction()
vehicleTempAction(driver,vehicle,action,time):void
The same as taskVehicleTempAction.
Parameters
driver
number | { handle: number; }
The driver, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
action
number
The action, as an integer of the game's own values.
time
number
The time in milliseconds.
Returns
void
Example
mp.game.task.vehicleTempAction(driver, vehicle, 1, 2000);
vehicleWaypointPlaybackOverrideSpeed()
vehicleWaypointPlaybackOverrideSpeed(vehicle,speed):void
Sets the speed of a vehicle's waypoint playback.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
speed
number
The speed in metres per second.
Returns
void
Example
mp.game.task.vehicleWaypointPlaybackOverrideSpeed(vehicle, 15);
vehicleWaypointPlaybackPause()
vehicleWaypointPlaybackPause(vehicle):void
Pauses a vehicle's waypoint playback.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
void
Example
mp.game.task.vehicleWaypointPlaybackPause(vehicle);
vehicleWaypointPlaybackResume()
vehicleWaypointPlaybackResume(vehicle):void
Resumes a vehicle's waypoint playback.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
void
Example
mp.game.task.vehicleWaypointPlaybackResume(vehicle);
vehicleWaypointPlaybackUseDefaultSpeed()
vehicleWaypointPlaybackUseDefaultSpeed(vehicle):void
Makes a vehicle's waypoint playback use the default speed of its path.
Parameters
vehicle
number | { handle: number; }
The vehicle, or its handle.
Returns
void
Example
mp.game.task.vehicleWaypointPlaybackUseDefaultSpeed(vehicle);
wanderInArea()
wanderInArea(ped,x,y,z,radius,minimalLength,timeBetweenWalks):void
The same as taskWanderInArea.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
x
number
The circle's centre X coordinate, in metres.
y
number
The circle's centre Y coordinate, in metres.
z
number
The circle's centre Z coordinate, in metres.
radius
number
The circle's radius, in metres.
minimalLength
number
The minimum length of a walk, in metres.
timeBetweenWalks
number
The time between walks, in milliseconds.
Returns
void
Example
mp.game.task.wanderInArea(ped, 0, 0, 70, 20, 5, 1000);
wanderStandard()
wanderStandard(ped,p1,p2):void
The same as taskWanderStandard.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
p1
number
A flag of the game, a float.
p2
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.wanderStandard(ped, 10, 0);
warpPedIntoVehicle()
warpPedIntoVehicle(ped,vehicle,seat):void
Puts a ped into a vehicle seat at once, without an animation.
Parameters
ped
number | { handle: number; }
The ped, or its handle.
vehicle
number | { handle: number; }
The vehicle, or its handle.
seat
number
The seat, as an integer (-1 for the driver).
Returns
void
Example
mp.game.task.warpPedIntoVehicle(ped, vehicle, -1);
waypointPlaybackGetIsPaused()
waypointPlaybackGetIsPaused(p0):Promise<boolean>
Whether a waypoint playback is paused.
Parameters
p0
number | { handle: number; }
The waypoint playback's ped, or its handle.
Returns
Promise<boolean>
A Promise of true while the playback is paused.
Example
const paused = await mp.game.task.waypointPlaybackGetIsPaused(ped);
waypointPlaybackOverrideSpeed()
waypointPlaybackOverrideSpeed(p0,p1,p2):void
Changes the speed of a ped's waypoint playback.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number
The speed, as a float.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.waypointPlaybackOverrideSpeed(ped, 2.0, false);
waypointPlaybackPause()
waypointPlaybackPause(p0,p1,p2):void
Pauses a waypoint playback.
Parameters
p0
number | { handle: number; }
The waypoint playback's ped, or its handle.
p1
boolean
A flag of the game, a bool.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.waypointPlaybackPause(ped, false, false);
waypointPlaybackResume()
waypointPlaybackResume(p0,p1,p2,p3):void
Resumes a waypoint playback.
Parameters
p0
number | { handle: number; }
The waypoint playback's ped, or its handle.
p1
boolean
A flag of the game, a bool.
p2
number
A flag of the game, as an integer.
p3
number
A flag of the game, as an integer.
Returns
void
Example
mp.game.task.waypointPlaybackResume(ped, false, 0, 0);
waypointPlaybackStartAimingAtPed()
waypointPlaybackStartAimingAtPed(p0,p1,p2):void
Makes a ped aim at another ped during a waypoint playback.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number | { handle: number; }
The ped to aim at, or its handle.
p2
boolean
A flag of the game, a bool.
Returns
void
Example
mp.game.task.waypointPlaybackStartAimingAtPed(ped, other, false);
waypointPlaybackStartShootingAtCoord()
waypointPlaybackStartShootingAtCoord(p0,x,y,z,p4,p5):void
Makes a ped shoot at a point during a waypoint playback.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
x
number
The point's X coordinate, in metres.
y
number
The point's Y coordinate, in metres.
z
number
The point's Z coordinate, in metres.
p4
boolean
A flag of the game, a bool.
p5
string | number
The firing pattern's hash, or its name.
Returns
void
Example
mp.game.task.waypointPlaybackStartShootingAtCoord(ped, 0, 0, 70, true, '<pattern name>');
waypointPlaybackStartShootingAtPed()
waypointPlaybackStartShootingAtPed(p0,p1,p2,p3):void
Makes a ped shoot at another ped during a waypoint playback.
Parameters
p0
number | { handle: number; }
The ped, or its handle.
p1
number | { handle: number; }
The ped to shoot at, or its handle.
p2
boolean
A flag of the game, a bool.
p3
string | number
The firing pattern's hash, or its name.
Returns
void
Example
mp.game.task.waypointPlaybackStartShootingAtPed(ped, other, true, '<pattern name>');
waypointPlaybackStopAimingOrShooting()
waypointPlaybackStopAimingOrShooting(p0):void
Makes a waypoint playback stop aiming and shooting.
Parameters
p0
number | { handle: number; }
The waypoint playback's ped, or its handle.
Returns
void
Example
mp.game.task.waypointPlaybackStopAimingOrShooting(ped);
waypointPlaybackUseDefaultSpeed()
waypointPlaybackUseDefaultSpeed(p0):void
Makes a waypoint playback use the default speed of its path.
Parameters
p0
number | { handle: number; }
The waypoint playback's ped, or its handle.
Returns
void
Example
mp.game.task.waypointPlaybackUseDefaultSpeed(ped);