Class Player
A player element
Players are the representation of any client that connects to the server.
Players are synchronised using sync packets that are sent by the client.
Assembly: SlipeServer.Server.dll
Syntax
public class Player : Ped
Constructors
|
Edit this page
View Source
Player()
Declaration
Fields
|
Edit this page
View Source
LastMovedUtc
Declaration
public DateTime LastMovedUtc
Field Value
Properties
|
Edit this page
View Source
AimDirection
Declaration
public Vector3 AimDirection { get; set; }
Property Value
|
Edit this page
View Source
AimOrigin
Declaration
public Vector3 AimOrigin { get; set; }
Property Value
|
Edit this page
View Source
AkimboTargetUp
Declaration
public bool AkimboTargetUp { get; set; }
Property Value
|
Edit this page
View Source
AssociatedElements
Any elements that are specifically associated with this player. This does not include elements that are associated with the server as a whole.
Declaration
public IElementCollection AssociatedElements { get; }
Property Value
|
Edit this page
View Source
BlurLevel
Declaration
public byte BlurLevel { get; set; }
Property Value
|
Edit this page
View Source
Camera
Declaration
public Camera Camera { get; }
Property Value
|
Edit this page
View Source
CameraDirection
Declaration
public Vector3 CameraDirection { get; set; }
Property Value
|
Edit this page
View Source
CameraPosition
Declaration
public Vector3 CameraPosition { get; set; }
Property Value
|
Edit this page
View Source
CameraRotation
Declaration
public float CameraRotation { get; set; }
Property Value
|
Edit this page
View Source
Client
Declaration
public IClient Client { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public Element? ContactElement { get; set; }
Property Value
|
Edit this page
View Source
Controls
Declaration
public Controls Controls { get; }
Property Value
|
Edit this page
View Source
DebugLogLevel
Declaration
public int DebugLogLevel { 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
ExternalMoneyLock
This object can be used in a lock statement to ensure thread-safety when handling money
Declaration
public object ExternalMoneyLock { get; }
Property Value
|
Edit this page
View Source
Declaration
public bool HasContact { get; set; }
Property Value
|
Edit this page
View Source
IsChatMuted
Declaration
public bool IsChatMuted { get; set; }
Property Value
|
Edit this page
View Source
IsChoking
Declaration
public bool IsChoking { get; set; }
Property Value
|
Edit this page
View Source
IsDucked
Declaration
public bool IsDucked { get; set; }
Property Value
|
Edit this page
View Source
IsMapForced
Declaration
public bool IsMapForced { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public bool IsNametagShowing { get; set; }
Property Value
|
Edit this page
View Source
IsOnGround
Declaration
public bool IsOnGround { get; set; }
Property Value
|
Edit this page
View Source
IsStealthAiming
Declaration
public bool IsStealthAiming { get; set; }
Property Value
|
Edit this page
View Source
IsSyncingVelocity
Declaration
public bool IsSyncingVelocity { get; set; }
Property Value
|
Edit this page
View Source
IsVoiceMuted
Declaration
public bool IsVoiceMuted { get; set; }
Property Value
|
Edit this page
View Source
Money
Declaration
public int Money { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public Color? NametagColor { get; set; }
Property Value
|
Edit this page
View Source
NametagText
Declaration
public string NametagText { get; set; }
Property Value
|
Edit this page
View Source
PendingScreenshots
Declaration
public Dictionary<int, PlayerPendingScreenshot> PendingScreenshots { get; }
Property Value
|
Edit this page
View Source
SyncingPeds
Declaration
public List<Ped> SyncingPeds { get; set; }
Property Value
|
Edit this page
View Source
SyncingVehicles
Declaration
public List<Vehicle> SyncingVehicles { get; set; }
Property Value
|
Edit this page
View Source
Team
Declaration
public Team? Team { get; set; }
Property Value
|
Edit this page
View Source
WantedLevel
Declaration
public byte WantedLevel { get; set; }
Property Value
|
Edit this page
View Source
WearsGoggles
Declaration
public bool WearsGoggles { get; set; }
Property Value
Methods
|
Edit this page
View Source
AssociateElement<T>(T)
Associates an element with the player. Meaning the element will be created for the player
and changes to the element will be relayed to the player.
Declaration
public T AssociateElement<T>(T element) where T : Element
Parameters
Type |
Name |
Description |
T |
element |
|
Returns
Type |
Description |
T |
Returns the element, allowing for method chaining
|
Type Parameters
|
Edit this page
View Source
AssociateWith(MtaServer)
Declaration
public Player AssociateWith(MtaServer server)
Parameters
Returns
|
Edit this page
View Source
CreateBlipFor(BlipIcon, ushort, short, byte, Color?)
Declaration
public Blip CreateBlipFor(BlipIcon icon, ushort visibleDistance = 16000, short ordering = 0, byte size = 2, Color? color = null)
Parameters
Returns
|
Edit this page
View Source
IsSubscribedTo(Element)
Declaration
public bool IsSubscribedTo(Element element)
Parameters
Type |
Name |
Description |
Element |
element |
|
Returns
|
Edit this page
View Source
Kick(PlayerDisconnectType, Element?)
Declaration
public void Kick(PlayerDisconnectType type = PlayerDisconnectType.CUSTOM, Element? responsibleElement = null)
Parameters
|
Edit this page
View Source
Kick(string, PlayerDisconnectType, Element?)
Declaration
public void Kick(string reason, PlayerDisconnectType type = PlayerDisconnectType.CUSTOM, Element? responsibleElement = null)
Parameters
|
Edit this page
View Source
Kill(Element?, DamageType, BodyPart, ulong, ulong)
Declaration
public override void Kill(Element? damager, DamageType damageType, BodyPart bodyPart, ulong animationGroup = 0, ulong animationId = 15)
Parameters
Overrides
|
Edit this page
View Source
PlaySound(byte)
Declaration
public void PlaySound(byte sound)
Parameters
Type |
Name |
Description |
byte |
sound |
|
|
Edit this page
View Source
RedirectTo(IPAddress, ushort, string?)
Declaration
public void RedirectTo(IPAddress server, ushort port, string? password = null)
Parameters
|
Edit this page
View Source
RemoveBind(string, KeyState)
Declaration
public void RemoveBind(string key, KeyState keyState = KeyState.Down)
Parameters
|
Edit this page
View Source
RemoveElement(Element)
Removes an element from being associated with the player, meaning the element will no longer be sync'd to the player
Declaration
public void RemoveElement(Element element)
Parameters
Type |
Name |
Description |
Element |
element |
|
|
Edit this page
View Source
ResendModPackets()
Declaration
public void ResendModPackets()
|
Edit this page
View Source
ResendPlayerACInfo()
Declaration
public void ResendPlayerACInfo()
|
Edit this page
View Source
ScreenshotEnd(int)
Declaration
public void ScreenshotEnd(int screenshotId)
Parameters
Type |
Name |
Description |
int |
screenshotId |
|
|
Edit this page
View Source
SetBind(Controls, KeyState)
Declaration
public void SetBind(KeyConstants.Controls control, KeyState keyState)
Parameters
|
Edit this page
View Source
SetBind(Keys, KeyState)
Declaration
public void SetBind(KeyConstants.Keys key, KeyState keyState)
Parameters
|
Edit this page
View Source
SetBind(string, KeyState)
Declaration
public void SetBind(string key, KeyState keyState = KeyState.Down)
Parameters
|
Edit this page
View Source
SetFpsLimit(ushort)
Declaration
public void SetFpsLimit(ushort limit)
Parameters
Type |
Name |
Description |
ushort |
limit |
|
|
Edit this page
View Source
SetMoney(int, bool)
Declaration
public void SetMoney(int money, bool instant = false)
Parameters
Type |
Name |
Description |
int |
money |
|
bool |
instant |
|
|
Edit this page
View Source
SetTransferBoxVisible(bool)
Declaration
public void SetTransferBoxVisible(bool isVisible)
Parameters
Type |
Name |
Description |
bool |
isVisible |
|
|
Edit this page
View Source
ShowHudComponent(HudComponent, bool)
Declaration
public void ShowHudComponent(HudComponent hudComponent, bool isVisible)
Parameters
|
Edit this page
View Source
Spawn(Vector3, float, ushort, byte, ushort, Team?)
Declaration
public void Spawn(Vector3 position, float rotation, ushort model, byte interior, ushort dimension, Team? team = null)
Parameters
|
Edit this page
View Source
SubscribeTo(Element)
Declaration
public void SubscribeTo(Element element)
Parameters
Type |
Name |
Description |
Element |
element |
|
|
Edit this page
View Source
TakeScreenshot(ushort, ushort, string, byte, uint, ushort)
Declaration
public void TakeScreenshot(ushort width, ushort height, string tag = "", byte quality = 30, uint maxBandwith = 5000, ushort maxPacketSize = 500)
Parameters
|
Edit this page
View Source
TriggerBoundKey(BindType, KeyState, string)
Declaration
public void TriggerBoundKey(BindType bindType, KeyState keyState, string key)
Parameters
|
Edit this page
View Source
TriggerCommand(string, string[])
Declaration
public void TriggerCommand(string command, string[] arguments)
Parameters
|
Edit this page
View Source
Declaration
public void TriggerCursorClicked(CursorButton button, bool isDown, Point position, Vector3 worldPosition, Element? element)
Parameters
|
Edit this page
View Source
TriggerDamaged(Element?, DamageType, BodyPart, float)
Declaration
public void TriggerDamaged(Element? damager, DamageType damageType, BodyPart bodyPart, float loss)
Parameters
|
Edit this page
View Source
TriggerDisconnected(QuitReason)
Declaration
public void TriggerDisconnected(QuitReason reason)
Parameters
|
Edit this page
View Source
TriggerJoined()
Declaration
public void TriggerJoined()
|
Edit this page
View Source
TriggerLuaEvent(string, Element?, params LuaValue[])
Declaration
public void TriggerLuaEvent(string name, Element? source = null, params LuaValue[] parameters)
Parameters
|
Edit this page
View Source
TriggerNetworkStatus(PlayerNetworkStatusType, uint)
Declaration
public void TriggerNetworkStatus(PlayerNetworkStatusType networkStatusType, uint ticks)
Parameters
|
Edit this page
View Source
TriggerPlayerACInfo(IEnumerable<byte>, uint, string, string)
Declaration
public void TriggerPlayerACInfo(IEnumerable<byte> detectedACList, uint d3d9Size, string d3d9MD5, string D3d9SHA256)
Parameters
|
Edit this page
View Source
TriggerPlayerDiagnosticInfo(uint, string)
Declaration
public void TriggerPlayerDiagnosticInfo(uint level, string message)
Parameters
|
Edit this page
View Source
TriggerPlayerModInfo(string, IEnumerable<ModInfoItem>)
Declaration
public void TriggerPlayerModInfo(string infoType, IEnumerable<ModInfoItem> modInfoItems)
Parameters
|
Edit this page
View Source
TriggerResourceStarted(ushort)
Declaration
public void TriggerResourceStarted(ushort netId)
Parameters
Type |
Name |
Description |
ushort |
netId |
|
|
Edit this page
View Source
TriggerSync()
Declaration
public void TriggerSync()
|
Edit this page
View Source
UnsubscribeFrom(Element)
Declaration
public void UnsubscribeFrom(Element element)
Parameters
Type |
Name |
Description |
Element |
element |
|
|
Edit this page
View Source
VoiceDataEnd()
Declaration
public void VoiceDataEnd()
|
Edit this page
View Source
VoiceDataStart(byte[])
Declaration
public void VoiceDataStart(byte[] voiceData)
Parameters
Type |
Name |
Description |
byte[] |
voiceData |
|
Events
|
Edit this page
View Source
AcInfoReceived
Declaration
public event ElementEventHandler<Player, PlayerACInfoArgs>? AcInfoReceived
Event Type
|
Edit this page
View Source
BindExecuted
Declaration
public event ElementEventHandler<Player, PlayerBindExecutedEventArgs>? BindExecuted
Event Type
|
Edit this page
View Source
CommandEntered
Declaration
public event ElementEventHandler<Player, PlayerCommandEventArgs>? CommandEntered
Event Type
|
Edit this page
View Source
Declaration
public event ElementChangedEventHandler<Player, Element?>? ContactElementChanged
Event Type
|
Edit this page
View Source
CursorClicked
Declaration
public event ElementEventHandler<Player, PlayerCursorClickedEventArgs>? CursorClicked
Event Type
|
Edit this page
View Source
Damaged
Declaration
public event ElementEventHandler<Player, PlayerDamagedEventArgs>? Damaged
Event Type
|
Edit this page
View Source
DiagnosticInfoReceived
Declaration
public event ElementEventHandler<Player, PlayerDiagnosticInfo>? DiagnosticInfoReceived
Event Type
|
Edit this page
View Source
Disconnected
Declaration
public event ElementEventHandler<Player, PlayerQuitEventArgs>? Disconnected
Event Type
|
Edit this page
View Source
IsChatMutedChanged
Declaration
public event ElementChangedEventHandler<Player, bool>? IsChatMutedChanged
Event Type
|
Edit this page
View Source
Declaration
public event ElementChangedEventHandler<Player, bool>? IsNametagShowingChanged
Event Type
|
Edit this page
View Source
Joined
Declaration
public event ElementEventHandler<Player, EventArgs>? Joined
Event Type
|
Edit this page
View Source
KeyBound
Declaration
public event ElementEventHandler<Player, PlayerBindKeyArgs>? KeyBound
Event Type
|
Edit this page
View Source
KeyUnbound
Declaration
public event ElementEventHandler<Player, PlayerBindKeyArgs>? KeyUnbound
Event Type
|
Edit this page
View Source
Kicked
Declaration
public event ElementEventHandler<Player, PlayerKickEventArgs>? Kicked
Event Type
|
Edit this page
View Source
ModInfoReceived
Declaration
public event ElementEventHandler<Player, PlayerModInfoArgs>? ModInfoReceived
Event Type
|
Edit this page
View Source
MoneyChanged
Declaration
public event ElementEventHandler<Player, PlayerMoneyChangedEventArgs>? MoneyChanged
Event Type
|
Edit this page
View Source
Declaration
public event ElementChangedEventHandler<Player, Color?>? NametagColorChanged
Event Type
|
Edit this page
View Source
NametagTextChanged
Declaration
public event ElementChangedEventHandler<Player, string>? NametagTextChanged
Event Type
|
Edit this page
View Source
NetworkStatusReceived
Declaration
public event ElementEventHandler<Player, PlayerNetworkStatusArgs>? NetworkStatusReceived
Event Type
|
Edit this page
View Source
PureSynced
Declaration
public event ElementEventHandler<Player, EventArgs>? PureSynced
Event Type
|
Edit this page
View Source
ResourceStarted
Declaration
public event ElementEventHandler<Player, PlayerResourceStartedEventArgs>? ResourceStarted
Event Type
|
Edit this page
View Source
ScreenshotTaken
Declaration
public event ElementEventHandler<Player, ScreenshotEventArgs>? ScreenshotTaken
Event Type
|
Edit this page
View Source
Spawned
Declaration
public event ElementEventHandler<Player, PlayerSpawnedEventArgs>? Spawned
Event Type
|
Edit this page
View Source
Subscribed
Declaration
public event ElementEventHandler<Player, PlayerSubscriptionEventArgs>? Subscribed
Event Type
|
Edit this page
View Source
TeamChanged
Declaration
public event ElementEventHandler<Player, PlayerTeamChangedArgs>? TeamChanged
Event Type
|
Edit this page
View Source
UnSubscribed
Declaration
public event ElementEventHandler<Player, PlayerSubscriptionEventArgs>? UnSubscribed
Event Type
|
Edit this page
View Source
VoiceDataEnded
Declaration
public event ElementEventHandler<Player, PlayerVoiceEndArgs>? VoiceDataEnded
Event Type
|
Edit this page
View Source
VoiceDataReceived
Declaration
public event ElementEventHandler<Player, PlayerVoiceStartArgs>? VoiceDataReceived
Event Type
|
Edit this page
View Source
WantedLevelChanged
Declaration
public event ElementChangedEventHandler<Player, byte>? WantedLevelChanged
Event Type
Extension Methods