PedClient

setPedCoordsKeepVehicle

SET_PED_COORDS_KEEP_VEHICLE0x9AFEFF481A85AB2E

The GTA V native SET_PED_COORDS_KEEP_VEHICLE of the PED namespace, as LS:MP client scripts call it: the global function setPedCoordsKeepVehicle, in JavaScript and in Lua.

SignatureJavaScript
setPedCoordsKeepVehicle(
  ped: Ped,
  posX: number,
  posY: number,
  posZ: number
): void
SignatureLua
setPedCoordsKeepVehicle(ped: Ped, posX: number, posY: number, posZ: number)

Usage

JavaScript
setPedCoordsKeepVehicle(ped, posX, posY, posZ);
Lua
setPedCoordsKeepVehicle(ped, posX, posY, posZ)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
setPedCoordsKeepVehicle(ped, pos);
Lua · with vectors
setPedCoordsKeepVehicle(ped, pos)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
posXfloatnumbernumber
posYfloatnumbernumber
posZfloatnumbernumber

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.

teleports ped to coords along with the vehicle ped is in

Reference

Namespace
Ped PED
In the game
void SET_PED_COORDS_KEEP_VEHICLE(Ped ped, float posX, float posY, float posZ)
Hash
0x9AFEFF481A85AB2E

Open in the interactive natives reference