Class Ped
A ped element
A ped (short for pedestrian) is a non player character, that can be controlled by code.
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
Fields
|
Edit this page
View Source
armor
Declaration
Field Value
|
Edit this page
View Source
health
Declaration
Field Value
|
Edit this page
View Source
model
Declaration
Field Value
Properties
|
Edit this page
View Source
Armor
Declaration
public float Armor { get; set; }
Property Value
|
Edit this page
View Source
Clothing
Declaration
public Clothing Clothing { get; init; }
Property Value
|
Edit this page
View Source
CurrentWeapon
Declaration
public Weapon? CurrentWeapon { get; set; }
Property Value
|
Edit this page
View Source
CurrentWeaponLock
Declaration
public object CurrentWeaponLock { get; }
Property Value
|
Edit this page
View Source
CurrentWeaponSlot
Declaration
public WeaponSlot CurrentWeaponSlot { get; set; }
Property Value
|
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
Overrides
|
Edit this page
View Source
EnteringVehicle
Declaration
public Vehicle? EnteringVehicle { get; set; }
Property Value
|
Edit this page
View Source
FightingStyle
Declaration
public FightingStyle FightingStyle { get; set; }
Property Value
|
Edit this page
View Source
Gravity
Declaration
public float Gravity { get; set; }
Property Value
|
Edit this page
View Source
HasJetpack
Declaration
public bool HasJetpack { get; set; }
Property Value
|
Edit this page
View Source
Health
Declaration
public float Health { get; set; }
Property Value
|
Edit this page
View Source
IsAlive
Declaration
public bool IsAlive { get; }
Property Value
|
Edit this page
View Source
IsHeadless
Declaration
public bool IsHeadless { get; set; }
Property Value
|
Edit this page
View Source
IsInWater
Declaration
public bool IsInWater { get; set; }
Property Value
|
Edit this page
View Source
IsOnFire
Declaration
public bool IsOnFire { get; set; }
Property Value
|
Edit this page
View Source
IsSyncable
Declaration
public bool IsSyncable { get; set; }
Property Value
|
Edit this page
View Source
JackingVehicle
Declaration
public Vehicle? JackingVehicle { get; set; }
Property Value
|
Edit this page
View Source
Model
Declaration
public ushort Model { get; set; }
Property Value
|
Edit this page
View Source
MoveAnimation
Declaration
public PedMoveAnimation MoveAnimation { get; set; }
Property Value
|
Edit this page
View Source
PedRotation
Declaration
public float PedRotation { get; set; }
Property Value
|
Edit this page
View Source
Seat
Declaration
public byte? Seat { get; set; }
Property Value
|
Edit this page
View Source
Syncer
Declaration
public Player? Syncer { get; set; }
Property Value
|
Edit this page
View Source
Target
Declaration
public Element? Target { get; set; }
Property Value
|
Edit this page
View Source
Vehicle
Declaration
public Vehicle? Vehicle { get; set; }
Property Value
|
Edit this page
View Source
VehicleAction
Declaration
public VehicleAction VehicleAction { get; set; }
Property Value
|
Edit this page
View Source
Weapons
Declaration
public WeaponCollection Weapons { get; set; }
Property Value
Methods
|
Edit this page
View Source
AddWeapon(WeaponId, ushort, bool)
Declaration
public void AddWeapon(WeaponId weaponId, ushort ammoCount, bool setAsCurrent = false)
Parameters
|
Edit this page
View Source
AssociateWith(MtaServer)
Declaration
public Ped AssociateWith(MtaServer server)
Parameters
Returns
|
Edit this page
View Source
GetAllStats()
Declaration
public Dictionary<PedStat, float> GetAllStats()
Returns
|
Edit this page
View Source
GetStat(PedStat)
Declaration
public float GetStat(PedStat stat)
Parameters
Returns
|
Edit this page
View Source
GetWeaponStat(WeaponId)
Declaration
public float GetWeaponStat(WeaponId weapon)
Parameters
Returns
|
Edit this page
View Source
InvokeWasted(PedWastedEventArgs)
Declaration
protected void InvokeWasted(PedWastedEventArgs args)
Parameters
|
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
|
Edit this page
View Source
Kill(DamageType, BodyPart)
Declaration
public void Kill(DamageType damageType = DamageType.WEAPONTYPE_UNARMED, BodyPart bodyPart = BodyPart.Torso)
Parameters
|
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
|
Edit this page
View Source
RemoveWeapon(WeaponId, ushort?)
Declaration
public void RemoveWeapon(WeaponId weaponId, ushort? ammoCount = null)
Parameters
|
Edit this page
View Source
Reset()
Declaration
|
Edit this page
View Source
SetAmmoCount(WeaponSlot, ushort, ushort?)
Declaration
public void SetAmmoCount(WeaponSlot weaponSlot, ushort count, ushort? inClip)
Parameters
|
Edit this page
View Source
SetAmmoCount(WeaponId, ushort, ushort?)
Declaration
public void SetAmmoCount(WeaponId weaponId, ushort count, ushort? inClip)
Parameters
|
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
|
Edit this page
View Source
SetAnimationProgress(string, float)
Declaration
public void SetAnimationProgress(string animation, float progress)
Parameters
|
Edit this page
View Source
SetAnimationSpeed(string, float)
Declaration
public void SetAnimationSpeed(string animation, float speed)
Parameters
|
Edit this page
View Source
SetStat(PedStat, float?)
Declaration
public void SetStat(PedStat stat, float? value)
Parameters
|
Edit this page
View Source
SetWeaponStat(WeaponId, float)
Declaration
public void SetWeaponStat(WeaponId weapon, float value)
Parameters
|
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
|
Edit this page
View Source
WarpIntoVehicle(Vehicle, byte)
Declaration
public void WarpIntoVehicle(Vehicle vehicle, byte seat = 0)
Parameters
Events
|
Edit this page
View Source
AmmoUpdated
Declaration
public event ElementEventHandler<Ped, AmmoUpdateEventArgs>? AmmoUpdated
Event Type
|
Edit this page
View Source
AnimationProgressChanged
Declaration
public event ElementEventHandler<Ped, PedAnimationProgressChangedEventArgs>? AnimationProgressChanged
Event Type
|
Edit this page
View Source
AnimationSpeedChanged
Declaration
public event ElementEventHandler<Ped, PedAnimationSpeedChangedEventArgs>? AnimationSpeedChanged
Event Type
|
Edit this page
View Source
AnimationStarted
Declaration
public event ElementEventHandler<Ped, PedAnimationStartedEventArgs>? AnimationStarted
Event Type
|
Edit this page
View Source
AnimationStopped
Declaration
public event ElementEventHandler<Ped, EventArgs>? AnimationStopped
Event Type
|
Edit this page
View Source
ArmourChanged
Declaration
public event ElementChangedEventHandler<Ped, float>? ArmourChanged
Event Type
|
Edit this page
View Source
ClothingChanged
Declaration
public event ElementEventHandler<Ped, ClothingChangedEventArgs>? ClothingChanged
Event Type
|
Edit this page
View Source
EnteringVehicleChanged
Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? EnteringVehicleChanged
Event Type
|
Edit this page
View Source
FightingStyleChanged
Declaration
public event ElementChangedEventHandler<Ped, FightingStyle>? FightingStyleChanged
Event Type
|
Edit this page
View Source
GravityChanged
Declaration
public event ElementChangedEventHandler<Ped, float>? GravityChanged
Event Type
|
Edit this page
View Source
HealthChanged
Declaration
public event ElementChangedEventHandler<Ped, float>? HealthChanged
Event Type
|
Edit this page
View Source
IsInWaterChanged
Declaration
public event ElementChangedEventHandler<Ped, bool>? IsInWaterChanged
Event Type
|
Edit this page
View Source
IsOnFireChanged
Declaration
public event ElementChangedEventHandler<Ped, bool>? IsOnFireChanged
Event Type
|
Edit this page
View Source
JackingVehicleChanged
Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? JackingVehicleChanged
Event Type
|
Edit this page
View Source
JetpackStateChanged
Declaration
public event ElementChangedEventHandler<Ped, bool>? JetpackStateChanged
Event Type
|
Edit this page
View Source
ModelChanged
Declaration
public event ElementChangedEventHandler<Ped, ushort>? ModelChanged
Event Type
|
Edit this page
View Source
StatChanged
Declaration
public event ElementEventHandler<Ped, PedStatChangedEventArgs>? StatChanged
Event Type
|
Edit this page
View Source
SyncerChanged
Declaration
public event ElementChangedEventHandler<Ped, Player?>? SyncerChanged
Event Type
|
Edit this page
View Source
TargetChanged
Declaration
public event ElementChangedEventHandler<Ped, Element?>? TargetChanged
Event Type
|
Edit this page
View Source
VehicleActionChanged
Declaration
public event ElementChangedEventHandler<Ped, VehicleAction>? VehicleActionChanged
Event Type
|
Edit this page
View Source
VehicleChanged
Declaration
public event ElementChangedEventHandler<Ped, Vehicle?>? VehicleChanged
Event Type
|
Edit this page
View Source
Wasted
Declaration
public event ElementEventHandler<Ped, PedWastedEventArgs>? Wasted
Event Type
|
Edit this page
View Source
WeaponOrAmmoChanged
Declaration
public event ElementEventHandler<Ped, PedWeaponOrAmmoChangedEventArgs>? WeaponOrAmmoChanged
Event Type
|
Edit this page
View Source
WeaponReceived
Declaration
public event ElementEventHandler<Ped, WeaponReceivedEventArgs>? WeaponReceived
Event Type
|
Edit this page
View Source
WeaponReloaded
Declaration
public event ElementEventHandler<Ped, EventArgs>? WeaponReloaded
Event Type
|
Edit this page
View Source
WeaponRemoved
Declaration
public event ElementEventHandler<Ped, WeaponRemovedEventArgs>? WeaponRemoved
Event Type
|
Edit this page
View Source
WeaponSlotChanged
Declaration
public event ElementChangedEventHandler<Ped, WeaponSlot>? WeaponSlotChanged
Event Type
Extension Methods