Show / Hide Table of Contents

Class Ped

A ped element A ped (short for pedestrian) is a non player character, that can be controlled by code.

Inheritance
object
Element
Ped
Player
Inherited Members
Element.Parent
Element.Children
Element.Associations
Element.AssociatedPlayers
Element.Id
Element.TimeContext
Element.Name
Element.position
Element.Position
Element.Right
Element.Up
Element.Forward
Element.rotation
Element.Rotation
Element.velocity
Element.Velocity
Element.turnVelocity
Element.TurnVelocity
Element.interior
Element.Interior
Element.dimension
Element.Dimension
Element.alpha
Element.Alpha
Element.areCollisionsEnabled
Element.AreCollisionsEnabled
Element.isCallPropagationEnabled
Element.IsCallPropagationEnabled
Element.isFrozen
Element.IsFrozen
Element.UpdateContext
Element.IsSync
Element.Subscribers
Element.ElementDataSubscriptions
Element.BroadcastableElementData
Element.Attachment
Element.AttachedElements
Element.IsDestroyed
Element.IsVisibleToEveryone
Element.AddSubscriber(Player)
Element.RemoveSubscriber(Player)
Element.GetAndIncrementTimeContext()
Element.CanUpdateSync(byte)
Element.Destroy()
Element.RunWithContext(Action, ElementUpdateContext)
Element.RunWithContext(Func<Task>, ElementUpdateContext)
Element.RunAsSync(Action, bool)
Element.RunAsSync(Func<Task>, bool)
Element.RemoveFrom(MtaServer)
Element.AssociateWith(Player)
Element.RemoveFrom(Player)
Element.UpdateAssociatedPlayers()
Element.AddChild(Element)
Element.RemoveChild(Element)
Element.IsChildOf(Element)
Element.SetData(string, LuaValue, DataSyncType)
Element.GetData(string, bool)
Element.SubscribeToData(Player, string)
Element.UnsubscribeFromData(Player, string)
Element.UnsubscribeFromAllData(Player)
Element.IsPlayerSubscribedToData(Player, string)
Element.GetPlayersSubcribedToData(string)
Element.AttachTo(Element, Vector3?, Vector3?)
Element.DetachFrom(Element)
Element.CreateFor(IEnumerable<Player>)
Element.CreateFor(Player)
Element.DestroyFor(IEnumerable<Player>)
Element.DestroyFor(Player)
Element.PositionChanged
Element.RotationChanged
Element.VelocityChanged
Element.TurnVelocityChanged
Element.InteriorChanged
Element.DimensionChanged
Element.AlphaChanged
Element.NameChanged
Element.CallPropagationChanged
Element.CollisionEnabledChanged
Element.FrozenChanged
Element.IdChanged
Element.AssociatedWith
Element.RemovedFrom
Element.DataChanged
Element.Attached
Element.Detached
Element.AttachedOffsetChanged
Element.Destroyed
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SlipeServer.Server.Elements
Assembly: SlipeServer.Server.dll
Syntax
public class Ped : Element

Constructors

| Edit this page View Source

Ped(PedModel, Vector3)

Declaration
public Ped(PedModel model, Vector3 position)
Parameters
Type Name Description
PedModel model
Vector3 position

Fields

| Edit this page View Source

armor

Declaration
protected float armor
Field Value
Type Description
float
| Edit this page View Source

health

Declaration
protected float health
Field Value
Type Description
float
| Edit this page View Source

model

Declaration
protected ushort model
Field Value
Type Description
ushort

Properties

| Edit this page View Source

Armor

Declaration
public float Armor { get; set; }
Property Value
Type Description
float
| Edit this page View Source

Clothing

Declaration
public Clothing Clothing { get; init; }
Property Value
Type Description
Clothing
| Edit this page View Source

CurrentWeapon

Declaration
public Weapon? CurrentWeapon { get; set; }
Property Value
Type Description
Weapon
| Edit this page View Source

CurrentWeaponLock

Declaration
public object CurrentWeaponLock { get; }
Property Value
Type Description
object
| Edit this page View Source

CurrentWeaponSlot

Declaration
public WeaponSlot CurrentWeaponSlot { get; set; }
Property Value
Type Description
WeaponSlot
| Edit this page View Source

ElementType

The element type as per MTA's specifications. Multiple C# types can share the same MTA element type.

Declaration
public override ElementType ElementType { get; }
Property Value
Type Description
ElementType
Overrides
Element.ElementType
| Edit this page View Source

EnteringVehicle

Declaration
public Vehicle? EnteringVehicle { get; set; }
Property Value
Type Description
Vehicle
| Edit this page View Source

FightingStyle

Declaration
public FightingStyle FightingStyle { get; set; }
Property Value
Type Description
FightingStyle
| Edit this page View Source

Gravity

Declaration
public float Gravity { get; set; }
Property Value
Type Description
float
| Edit this page View Source

HasJetpack

Declaration
public bool HasJetpack { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Health

Declaration
public float Health { get; set; }
Property Value
Type Description
float
| Edit this page View Source

IsAlive

Declaration
public bool IsAlive { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsHeadless

Declaration
public bool IsHeadless { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsInWater

Declaration
public bool IsInWater { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsOnFire

Declaration
public bool IsOnFire { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsSyncable

Declaration
public bool IsSyncable { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

JackingVehicle

Declaration
public Vehicle? JackingVehicle { get; set; }
Property Value
Type Description
Vehicle
| Edit this page View Source

Model

Declaration
public ushort Model { get; set; }
Property Value
Type Description
ushort
| Edit this page View Source

MoveAnimation

Declaration
public PedMoveAnimation MoveAnimation { get; set; }
Property Value
Type Description
PedMoveAnimation
| Edit this page View Source

PedRotation

Declaration
public float PedRotation { get; set; }
Property Value
Type Description
float
| Edit this page View Source

Seat

Declaration
public byte? Seat { get; set; }
Property Value
Type Description
byte?
| Edit this page View Source

Syncer

Declaration
public Player? Syncer { get; set; }
Property Value
Type Description
Player
| Edit this page View Source

Target

Declaration
public Element? Target { get; set; }
Property Value
Type Description
Element
| Edit this page View Source

Vehicle

Declaration
public Vehicle? Vehicle { get; set; }
Property Value
Type Description
Vehicle
| Edit this page View Source

VehicleAction

Declaration
public VehicleAction VehicleAction { get; set; }
Property Value
Type Description
VehicleAction
| Edit this page View Source

Weapons

Declaration
public WeaponCollection Weapons { get; set; }
Property Value
Type Description
WeaponCollection

Methods

| Edit this page View Source

AddWeapon(WeaponId, ushort, bool)

Declaration
public void AddWeapon(WeaponId weaponId, ushort ammoCount, bool setAsCurrent = false)
Parameters
Type Name Description
WeaponId weaponId
ushort ammoCount
bool setAsCurrent
| Edit this page View Source

AssociateWith(MtaServer)

Declaration
public Ped AssociateWith(MtaServer server)
Parameters
Type Name Description
MtaServer server
Returns
Type Description
Ped
| Edit this page View Source

GetAllStats()

Declaration
public Dictionary<PedStat, float> GetAllStats()
Returns
Type Description
Dictionary<PedStat, float>
| Edit this page View Source

GetStat(PedStat)

Declaration
public float GetStat(PedStat stat)
Parameters
Type Name Description
PedStat stat
Returns
Type Description
float
| Edit this page View Source

GetWeaponStat(WeaponId)

Declaration
public float GetWeaponStat(WeaponId weapon)
Parameters
Type Name Description
WeaponId weapon
Returns
Type Description
float
| Edit this page View Source

InvokeWasted(PedWastedEventArgs)

Declaration
protected void InvokeWasted(PedWastedEventArgs args)
Parameters
Type Name Description
PedWastedEventArgs args
| Edit this page View Source

Kill(Element?, DamageType, BodyPart, ulong, ulong)

Declaration
public virtual void Kill(Element? damager, DamageType damageType, BodyPart bodyPart, ulong animationGroup = 0, ulong animationId = 15)
Parameters
Type Name Description
Element damager
DamageType damageType
BodyPart bodyPart
ulong animationGroup
ulong animationId
| Edit this page View Source

Kill(DamageType, BodyPart)

Declaration
public void Kill(DamageType damageType = DamageType.WEAPONTYPE_UNARMED, BodyPart bodyPart = BodyPart.Torso)
Parameters
Type Name Description
DamageType damageType
BodyPart bodyPart
| Edit this page View Source

ReloadWeapon()

Declaration
public void ReloadWeapon()
| Edit this page View Source

RemoveFromVehicle(bool)

Declaration
public void RemoveFromVehicle(bool warpOut = true)
Parameters
Type Name Description
bool warpOut
| Edit this page View Source

RemoveWeapon(WeaponSlot, ushort?)

Declaration
public void RemoveWeapon(WeaponSlot weaponSlot, ushort? ammoCount = null)
Parameters
Type Name Description
WeaponSlot weaponSlot
ushort? ammoCount
| Edit this page View Source

RemoveWeapon(WeaponId, ushort?)

Declaration
public void RemoveWeapon(WeaponId weaponId, ushort? ammoCount = null)
Parameters
Type Name Description
WeaponId weaponId
ushort? ammoCount
| Edit this page View Source

Reset()

Declaration
protected void Reset()
| Edit this page View Source

SetAmmoCount(WeaponSlot, ushort, ushort?)

Declaration
public void SetAmmoCount(WeaponSlot weaponSlot, ushort count, ushort? inClip)
Parameters
Type Name Description
WeaponSlot weaponSlot
ushort count
ushort? inClip
| Edit this page View Source

SetAmmoCount(WeaponId, ushort, ushort?)

Declaration
public void SetAmmoCount(WeaponId weaponId, ushort count, ushort? inClip)
Parameters
Type Name Description
WeaponId weaponId
ushort count
ushort? inClip
| Edit this page View Source

SetAnimation(string, string, TimeSpan?, bool, bool, bool, bool, TimeSpan?, bool)

Declaration
public void SetAnimation(string group, string animation, TimeSpan? time = null, bool loops = true, bool updatesPosition = true, bool isInteruptable = true, bool freezesOnLastFrame = true, TimeSpan? blendTime = null, bool retainPedState = false)
Parameters
Type Name Description
string group
string animation
TimeSpan? time
bool loops
bool updatesPosition
bool isInteruptable
bool freezesOnLastFrame
TimeSpan? blendTime
bool retainPedState
| Edit this page View Source

SetAnimationProgress(string, float)

Declaration
public void SetAnimationProgress(string animation, float progress)
Parameters
Type Name Description
string animation
float progress
| Edit this page View Source

SetAnimationSpeed(string, float)

Declaration
public void SetAnimationSpeed(string animation, float speed)
Parameters
Type Name Description
string animation
float speed
| Edit this page View Source

SetStat(PedStat, float?)

Declaration
public void SetStat(PedStat stat, float? value)
Parameters
Type Name Description
PedStat stat
float? value
| Edit this page View Source

SetWeaponStat(WeaponId, float)

Declaration
public void SetWeaponStat(WeaponId weapon, float value)
Parameters
Type Name Description
WeaponId weapon
float value
| Edit this page View Source

StopAnimation()

Declaration
public void StopAnimation()
| Edit this page View Source

TriggerWeaponAmmoUpdate(WeaponId, ushort, ushort)

Declaration
public void TriggerWeaponAmmoUpdate(WeaponId weapon, ushort ammo, ushort ammoInClip)
Parameters
Type Name Description
WeaponId weapon
ushort ammo
ushort ammoInClip
| Edit this page View Source

WarpIntoVehicle(Vehicle, byte)

Declaration
public void WarpIntoVehicle(Vehicle vehicle, byte seat = 0)
Parameters
Type Name Description
Vehicle vehicle
byte seat

Events

| Edit this page View Source

AmmoUpdated

Declaration
public event ElementEventHandler<Ped, AmmoUpdateEventArgs>? AmmoUpdated
Event Type
Type Description
ElementEventHandler<Ped, AmmoUpdateEventArgs>
| Edit this page View Source

AnimationProgressChanged

Declaration
public event ElementEventHandler<Ped, PedAnimationProgressChangedEventArgs>? AnimationProgressChanged
Event Type
Type Description
ElementEventHandler<Ped, PedAnimationProgressChangedEventArgs>
| Edit this page View Source

AnimationSpeedChanged

Declaration
public event ElementEventHandler<Ped, PedAnimationSpeedChangedEventArgs>? AnimationSpeedChanged
Event Type
Type Description
ElementEventHandler<Ped, PedAnimationSpeedChangedEventArgs>
| Edit this page View Source

AnimationStarted

Declaration
public event ElementEventHandler<Ped, PedAnimationStartedEventArgs>? AnimationStarted
Event Type
Type Description
ElementEventHandler<Ped, PedAnimationStartedEventArgs>
| Edit this page View Source

AnimationStopped

Declaration
public event ElementEventHandler<Ped, EventArgs>? AnimationStopped
Event Type
Type Description
ElementEventHandler<Ped, EventArgs>
| Edit this page View Source

ArmourChanged

Declaration
public event ElementChangedEventHandler<Ped, float>? ArmourChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, float>
| Edit this page View Source

ClothingChanged

Declaration
public event ElementEventHandler<Ped, ClothingChangedEventArgs>? ClothingChanged
Event Type
Type Description
ElementEventHandler<Ped, ClothingChangedEventArgs>
| Edit this page View Source

EnteringVehicleChanged

Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? EnteringVehicleChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, Vehicle>
| Edit this page View Source

FightingStyleChanged

Declaration
public event ElementChangedEventHandler<Ped, FightingStyle>? FightingStyleChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, FightingStyle>
| Edit this page View Source

GravityChanged

Declaration
public event ElementChangedEventHandler<Ped, float>? GravityChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, float>
| Edit this page View Source

HealthChanged

Declaration
public event ElementChangedEventHandler<Ped, float>? HealthChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, float>
| Edit this page View Source

IsInWaterChanged

Declaration
public event ElementChangedEventHandler<Ped, bool>? IsInWaterChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, bool>
| Edit this page View Source

IsOnFireChanged

Declaration
public event ElementChangedEventHandler<Ped, bool>? IsOnFireChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, bool>
| Edit this page View Source

JackingVehicleChanged

Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? JackingVehicleChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, Vehicle>
| Edit this page View Source

JetpackStateChanged

Declaration
public event ElementChangedEventHandler<Ped, bool>? JetpackStateChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, bool>
| Edit this page View Source

ModelChanged

Declaration
public event ElementChangedEventHandler<Ped, ushort>? ModelChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, ushort>
| Edit this page View Source

StatChanged

Declaration
public event ElementEventHandler<Ped, PedStatChangedEventArgs>? StatChanged
Event Type
Type Description
ElementEventHandler<Ped, PedStatChangedEventArgs>
| Edit this page View Source

SyncerChanged

Declaration
public event ElementChangedEventHandler<Ped, Player?>? SyncerChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, Player>
| Edit this page View Source

TargetChanged

Declaration
public event ElementChangedEventHandler<Ped, Element?>? TargetChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, Element>
| Edit this page View Source

VehicleActionChanged

Declaration
public event ElementChangedEventHandler<Ped, VehicleAction>? VehicleActionChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, VehicleAction>
| Edit this page View Source

VehicleChanged

Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? VehicleChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, Vehicle>
| Edit this page View Source

Wasted

Declaration
public event ElementEventHandler<Ped, PedWastedEventArgs>? Wasted
Event Type
Type Description
ElementEventHandler<Ped, PedWastedEventArgs>
| Edit this page View Source

WeaponOrAmmoChanged

Declaration
public event ElementEventHandler<Ped, PedWeaponOrAmmoChangedEventArgs>? WeaponOrAmmoChanged
Event Type
Type Description
ElementEventHandler<Ped, PedWeaponOrAmmoChangedEventArgs>
| Edit this page View Source

WeaponReceived

Declaration
public event ElementEventHandler<Ped, WeaponReceivedEventArgs>? WeaponReceived
Event Type
Type Description
ElementEventHandler<Ped, WeaponReceivedEventArgs>
| Edit this page View Source

WeaponReloaded

Declaration
public event ElementEventHandler<Ped, EventArgs>? WeaponReloaded
Event Type
Type Description
ElementEventHandler<Ped, EventArgs>
| Edit this page View Source

WeaponRemoved

Declaration
public event ElementEventHandler<Ped, WeaponRemovedEventArgs>? WeaponRemoved
Event Type
Type Description
ElementEventHandler<Ped, WeaponRemovedEventArgs>
| Edit this page View Source

WeaponSlotChanged

Declaration
public event ElementChangedEventHandler<Ped, WeaponSlot>? WeaponSlotChanged
Event Type
Type Description
ElementChangedEventHandler<Ped, WeaponSlot>

Extension Methods

ElementPropertyRelayingExtensions.AddRelayers(Element)
ElementPropertyRelayingExtensions.RelayChange(Element, Packet)
PedPropertyRelayingExtensions.AddPedRelayers(Ped)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX