REVO / API version 0.0.10
LocalPed
Created asynchronously when streamed in. Collections and lookups include only this resource’s peds.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LocalPed(
model,position,heading):LocalPed
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
model |
string | number |
- |
position |
IVector3 |
- |
heading |
number |
Heading in radians. |
Returns
Section titled “Returns”LocalPed
Overrides
Section titled “Overrides”Ped.constructor
Properties
Section titled “Properties”| Property | Type | Details |
|---|---|---|
armor |
number |
|
dead |
boolean |
|
desiredHeading |
number |
|
dimension |
number |
World ID, default 0. Writable on local objects created by this resource. The server controls other objects. globalDimension makes the object visible in every numbered world. |
heading |
number |
Heading in radians. |
health |
number |
|
id |
number |
Local ID, assigned independently on the client and server. |
isLocallySimulated |
boolean |
Simulation authority does not grant permission to change server-owned state. |
isNetworked |
false |
|
isStreamedIn |
boolean |
|
maxHealth |
number |
|
moveBlendRatio |
number |
|
netOwner |
Player | null |
|
networkId |
null |
Server-assigned network ID, or null without replication. Separate from id. |
ready |
boolean |
The initial server state has been applied, or a client-only entity has streamed in. |
scriptID |
number |
GTA handle, or 0 while not streamed in. Do not retain it across frames. |
streamDistance |
number | null |
Per-object distance in metres. null uses the streamer’s default. |
streamingEnabled |
boolean |
Enables automatic streaming. Disabling it preserves the current streaming state. A dimension mismatch still suspends it until its dimension is visible again. |
type |
BaseType |
|
valid |
boolean |
|
vehicleOccupancy |
IVehicleOccupancy | null |
Synchronized seat state. null for a client-only ped. |
all |
readonly LocalPed[] |
|
count |
number |
Accessors
Section titled “Accessors”| Accessor | Type | Details |
|---|---|---|
angVelocity |
Read: Vector3Write: IVector3 |
Angular velocity in radians per second. |
modelHash |
Read: numberWrite: string | number |
Accepts a model name or nonzero hash of the same entity type. Returns the old hash until the new model is applied. |
pos |
Read: Vector3Write: IVector3 |
|
quaternion |
Read: QuaternionWrite: IQuaternion |
|
rot |
Read: Vector3Write: IVector3 |
Euler angles in radians, applied X, then Y, then Z. |
velocity |
Read: Vector3Write: IVector3 |
Methods
Section titled “Methods”activatePhysics()
Section titled “activatePhysics()”activatePhysics():
void
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”aimGunAtCoord()
Section titled “aimGunAtCoord()”aimGunAtCoord(
position):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position |
IVector3 |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”clearProp()
Section titled “clearProp()”clearProp(
prop):boolean
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
prop |
PedProp |
Returns
Section titled “Returns”boolean
clearProps()
Section titled “clearProps()”clearProps():
boolean
Returns
Section titled “Returns”boolean
clearTasks()
Section titled “clearTasks()”clearTasks():
void
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”clearTasksImmediately()
Section titled “clearTasksImmediately()”clearTasksImmediately():
void
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Deletes an entity created by this resource. Throws if the entity is networked, belongs to another resource, has been destroyed, or cannot be removed from GTA.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”getComponentVariation()
Section titled “getComponentVariation()”getComponentVariation(
component):IPedComponentVariation|null
Requested clothing, or null if unset.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
component |
PedComponent |
Returns
Section titled “Returns”IPedComponentVariation | null
getFaceFeature()
Section titled “getFaceFeature()”getFaceFeature(
feature):number|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
feature |
PedFaceFeature |
Returns
Section titled “Returns”number | null
getHairColor()
Section titled “getHairColor()”getHairColor():
IPedHairColor|null
Returns
Section titled “Returns”IPedHairColor | null
getHeadBlendData()
Section titled “getHeadBlendData()”getHeadBlendData():
Required<IPedHeadBlendData> |null
Copy of the requested blend with all fields filled, or null if unset.
Returns
Section titled “Returns”Required<IPedHeadBlendData> | null
getHeadOverlay()
Section titled “getHeadOverlay()”getHeadOverlay(
overlay):IPedHeadOverlay|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
overlay |
PedHeadOverlay |
Returns
Section titled “Returns”IPedHeadOverlay | null
getProp()
Section titled “getProp()”getProp(
prop):IPedPropVariation|null
Requested prop, or null if unset. A cleared prop has drawable -1.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
prop |
PedProp |
Returns
Section titled “Returns”IPedPropVariation | null
getSyncedMeta()
Section titled “getSyncedMeta()”Call Signature
Section titled “Call Signature”getSyncedMeta<
K>(key):ICustomBaseSyncedMeta[K] |undefined
Returns a copy. Client-only objects have no synced metadata.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends never |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
K |
Returns
Section titled “Returns”ICustomBaseSyncedMeta[K] | undefined
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”getSyncedMeta<
T>(key):T|undefined
Returns a copy. Client-only objects have no synced metadata.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T |
TransportValue |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”T | undefined
Inherited from
Section titled “Inherited from”getSyncedMetaKeys()
Section titled “getSyncedMetaKeys()”getSyncedMetaKeys():
string[]
Returns
Section titled “Returns”string[]
Inherited from
Section titled “Inherited from”goStraightToCoord()
Section titled “goStraightToCoord()”goStraightToCoord(
position,moveBlendRatio,heading,targetRadius):void
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
position |
IVector3 |
- |
moveBlendRatio |
number |
- |
heading |
number |
Heading in radians. |
targetRadius |
number |
- |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”hasSyncedMeta()
Section titled “hasSyncedMeta()”hasSyncedMeta(
key):boolean
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”jump()
Section titled “jump()”jump():
void
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”reloadWeapon()
Section titled “reloadWeapon()”reloadWeapon():
void
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setBlockingOfNonTemporaryEvents()
Section titled “setBlockingOfNonTemporaryEvents()”setBlockingOfNonTemporaryEvents(
blocked):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
blocked |
boolean |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Ped.setBlockingOfNonTemporaryEvents
setComponentVariation()
Section titled “setComponentVariation()”setComponentVariation(
component,drawable,texture?,palette?):boolean
Uses global drawable indices. Can be set before stream-in and persists across streaming and model changes. Unset components use the model’s default outfit. Unsupported combinations are skipped. Returns false outside these ranges: component 0..11, drawable 0..65535, texture 0..255, palette 0..3. Texture and palette default to 0. Throws if the ped is destroyed, networked or owned by another resource.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
component |
PedComponent |
drawable |
number |
texture? |
number |
palette? |
number |
Returns
Section titled “Returns”boolean
setDefaultComponentVariation()
Section titled “setDefaultComponentVariation()”setDefaultComponentVariation():
boolean
Resets clothing to model defaults. Keeps prop selections.
Returns
Section titled “Returns”boolean
setFaceFeature()
Section titled “setFaceFeature()”setFaceFeature(
feature,scale):boolean
Scale: [-1, 1]. If no blend is set, face, overlay and hair setters use parent indices 0.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
feature |
PedFaceFeature |
scale |
number |
Returns
Section titled “Returns”boolean
setHairColor()
Section titled “setHairColor()”setHairColor(
color,highlight?):boolean
Colours: 0..63. Highlight defaults to 0. Set the hairstyle through PedComponent.Hair.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
color |
number |
highlight? |
number |
Returns
Section titled “Returns”boolean
setHeadBlendData()
Section titled “setHeadBlendData()”setHeadBlendData(
data):boolean
Applies to mp_m_freemode_01 and mp_f_freemode_01. Other models store the values without applying them. Uses the same ownership and persistence rules as clothing. Keeps face features, overlays and hair colours. Returns false for out-of-range values. Wrong types and non-finite numbers throw TypeError.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data |
IPedHeadBlendData |
Returns
Section titled “Returns”boolean
setHeadOverlay()
Section titled “setHeadOverlay()”setHeadOverlay(
overlay,index,opacity?):boolean
Index: 0..254, or -1 to disable. Unavailable indices also disable the overlay. Opacity: [0, 1], default 1. Keeps the overlay’s colours.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
overlay |
PedHeadOverlay |
index |
number |
opacity? |
number |
Returns
Section titled “Returns”boolean
setHeadOverlayColor()
Section titled “setHeadOverlayColor()”setHeadOverlayColor(
overlay,colorType,color,secondColor?):boolean
Colours: 0..63. Use setHeadOverlay to enable the overlay. Hair palette: facial hair, eyebrows, chest hair. Makeup palette: blush and lipstick.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
overlay |
PedHeadOverlay |
colorType |
PedOverlayColorType |
color |
number |
secondColor? |
number |
Returns
Section titled “Returns”boolean
setPlayerControl()
Section titled “setPlayerControl()”setPlayerControl(
enabled):void
Only available on Player.local. Throws for any other ped.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setProp()
Section titled “setProp()”setProp(
prop,drawable,texture?):boolean
Prop: 0..12, drawable: -1..65535, texture: 0..255 (default 0). Drawable -1 requires texture 0 and clears the prop. Unsupported combinations leave it cleared. Uses the same ownership, persistence and validation rules as setComponentVariation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
prop |
PedProp |
drawable |
number |
texture? |
number |
Returns
Section titled “Returns”boolean
setRagdoll()
Section titled “setRagdoll()”setRagdoll(
enabled):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
enabled |
boolean |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”shootAtCoord()
Section titled “shootAtCoord()”shootAtCoord(
position):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
position |
IVector3 |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”standStill()
Section titled “standStill()”standStill(
durationMs):void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
durationMs |
number |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”getById()
Section titled “getById()”
staticgetById(id):LocalPed|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
number |
Returns
Section titled “Returns”LocalPed | null
Overrides
Section titled “Overrides”getByNetworkId()
Section titled “getByNetworkId()”
staticgetByNetworkId(networkId):null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
networkId |
number |
Returns
Section titled “Returns”null
Overrides
Section titled “Overrides”getByScriptId()
Section titled “getByScriptId()”
staticgetByScriptId(scriptID):LocalPed|null
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
scriptID |
number |
Returns
Section titled “Returns”LocalPed | null