đ§SimCharacter
General game-character, properties & functions are derived from SimObject.
Last updated
General game-character, properties & functions are derived from SimObject.
Last updated
Name | Type | Description |
---|---|---|
SimCharacter.Create(model: Hash, coords: Vector3, heading: float)
: SimCharacter
Argument | Type | Description |
---|---|---|
Returns SimCharacter object when successfully created. Note: certain models can crash game!
SimCharacter.Get(object: SimObject)
: SimCharacter
This will cast SimObject to SimCharacter use this only if you know what you're doing!
SimCharacter.GetLocalPlayer()
: SimCharacter
Returns a SimCharacter object of localplayer (Wei Shen).
SimCharacter.SetAttackRights(toggle: boolean)
Toggles attack rights. Note: by default most peds have no Attack Rights which means they cant be attacked by other peds neither they can attack them.
SimCharacter.GetTarget(type: TargetType)
: SimObject
SimCharacter.SetTarget(type: TargetType, object: SimObject)
SimCharacter.SetTargetLock(type: TargetType, lock: boolean, modifycollision: boolean)
SimCharacter.ClearTarget(type: TargetType)
SimCharacter.PlayActionNode(id: integer)
: boolean
Returns true if action was found and successfully queued for play.
SimCharacter.PlayActionNodeByName(name: string)
: boolean
Returns true if action was found and successfully queued for play. Note: this requires full path for action name and most of them might not be resolved so I recommend rather playing them by ID.
SimCharacter.StopActionNode()
Stop any currently playing action and restore to first action behavior the character started with.
SimCharacter.SetAIObjective(type: AIObjective)
Sets a current AI Objective for SimCharacter.
SimCharacter.GetBonesCount()
: integer
Returns number of bone count for SimCharacter. If character for some reason has no bone data it returns -1.
SimCharacter.GetBoneName(index: integer)
: string
Returns name of the bone of desired index, if this fails for some reason the return value will be null.
SimCharacter.GetBonePosition(bone: Hash)
: Vector3
Returns world position of the desired bone, if this fails return value is [0, 0, 0
].
SimCharacter.GetBoneRotation(bone: Hash)
: Vector3
Returns rotation of the desired bone, if this fails return value is [0, 0, 0
].
SimCharacter.AttachProp(prop: SimObjectProp, bone: CharacterBone, propbone: PropBone)
: boolean
Returns true when prop has been successfully attached to the character, this can fail if character or propr doesn't have default bone or when you specify own bone and it doesn't exist.
SimCharacter.DetachProp(prop: SimObjectProp)
: boolean
Returns true if prop has been successfully detached from the character.
SimCharacter.GetOccupantState()
: CharacterOccupantState
Returns occupant state if SimCharacter is entering/exiting/sitting in some vehicle.
SimCharacter.GetCurrentVehicle()
: SimVehicle
Returns SimVehicle object if SimCharacter is occupant of any vehicle otherwise null.
SimCharacter.GetCurrentVehicleSeatIndex()
: integer
Returns seat index if SimCharacter is occupant of any vehicle otherwise -1.
SimCharacter.PlaceInVehicle(vehicle: SimVehicle, seatIndex: integer)
: boolean
Returns true if SimCharacter was successfully placed in vehicle, this can fail when seat is already occupied. Note: This will teleport character straight to the seat, there is no animation!
SimCharacter.ExitVehicle()
Removes SimCharacter from current vehicle. Note: This will teleport character straight out of the vehicle, there is no animation!
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
Argument | Type | Description |
---|---|---|
FactionClass
integer
Enum: FactionClass
FightingClass
integer
Enum: FightingClass
Gender
integer
Enum: Gender
Heading
float
Direction of facing
Health
integer
(0 to 400)
HealthMax
integer
-
Invulnerable
boolean
-
TakingDamage
boolean
-
Tired
boolean
-
model
Hash
coords
Vector3
Position of new character
heading
float
Heading of new character
object
SimObject
Valid SimObject
toggle
boolean
-
type
-
type
-
object
SimObject
-
type
-
lock
boolean
-
modifycollision
boolean
Set true if interacting with physics object
type
-
id
integer
name
string
type
-
index
integer
-
bone
Hash
-
bone
Hash
-
prop
-
bone
CharacterBone (Hash)
(Optional)
propbone
PropBone (Hash)
(Optional)
prop
-
vehicle
-
seatindex
integer
0 - Driver, 1...4 - Passenger