Show / Hide Table of Contents

Class Player

Class for a player in the MTA server

Inheritance
Object
Element
PhysicalElement
SharedPed
Ped
Player
Inherited Members
Ped.Armor
Ped.FightingStyle
Ped.Gravity
Ped.Chocking
Ped.HasJetpack
Ped.ReloadWeapon()
Ped.GiveWeapon(SharedWeaponModel, Int32, Boolean)
Ped.SetAmmo(SharedWeaponModel, Int32, Int32)
Ped.TakeAllWeapons()
Ped.TakeWeapon(SharedWeaponModel)
Ped.TakeAmmo(SharedWeaponModel, Int32)
Ped.OnWasted
Ped.OnWeaponSwitch
SharedPed.WeaponSlot
SharedPed.ContactElement
SharedPed.OccupiedVehicle
SharedPed.VehicleSeat
SharedPed.IsDead
SharedPed.DoingGangDriveby
SharedPed.IsDucked
SharedPed.Headless
SharedPed.IsInVehicle
SharedPed.OnFire
SharedPed.IsOnGround
SharedPed.Target
SharedPed.WalkingStyle
SharedPed.Weapon
SharedPed.AmmoInClip
SharedPed.TotalAmmo
SharedPed.IsClothesSlotTattoo(ClothesSlot)
SharedPed.AddClothes(ClothesTexture, ClothesModel, ClothesSlot)
SharedPed.AddClothes(ClothesSlot, Int32)
SharedPed.AddClothes(ClothesTexture, ClothesModel)
SharedPed.GetClothesModel(ClothesSlot)
SharedPed.GetClothesTexture(ClothesSlot)
SharedPed.RemoveClothes(ClothesSlot)
SharedPed.GetWeaponInSlot(WeaponSlot)
SharedPed.GetAmmoInClip(WeaponSlot)
SharedPed.GetTotalAmmo(WeaponSlot)
SharedPed.SetAnimation(Animation, Boolean, Int32, Boolean, Boolean, Boolean, Int32, Boolean)
SharedPed.ResetAnimation()
SharedPed.SetAnimationProgress(Animation, Single)
SharedPed.SetAnimationSpeed(Animation, Single)
SharedPed.GedStat(PedStat)
SharedPed.SetStat(PedStat, Single)
SharedPed.Kill(SharedPed, SharedWeaponModel, BodyPart, Boolean)
SharedPed.Kill(SharedPed)
SharedPed.Kill()
SharedPed.RemoveFromVehicle()
SharedPed.WarpIntoVehicle(SharedVehicle, Seat)
SharedPed.WarpIntoVehicle(SharedVehicle)
SharedPed.FaceElement(PhysicalElement)
SharedPed.IsValidSkin(Int32)
PhysicalElement.Dimension
PhysicalElement.Interior
PhysicalElement.Frozen
PhysicalElement.Alpha
PhysicalElement.Health
PhysicalElement.Model
PhysicalElement.CollisionShape
PhysicalElement.CollisionsEnabled
PhysicalElement.LowLODElement
PhysicalElement.DoubleSided
PhysicalElement.IsInWater
PhysicalElement.IsLowLOD
PhysicalElement.Position
PhysicalElement.Rotation
PhysicalElement.QuaternionRotation
PhysicalElement.Matrix
PhysicalElement.ForwardVector
PhysicalElement.RightVector
PhysicalElement.UpVector
PhysicalElement.Velocity
PhysicalElement.AngularVelocity
PhysicalElement.AngularQuaternionVelocity
PhysicalElement.ToAttached
PhysicalElement.IsAttached
PhysicalElement.IsWithinCollisionShape(CollisionShape)
PhysicalElement.IsWithinMarker(SharedMarker)
PhysicalElement.AttachTo(PhysicalElement, Matrix4x4)
PhysicalElement.AttachTo(PhysicalElement, Vector3, Vector3)
PhysicalElement.AttachTo(PhysicalElement, Vector3, Quaternion)
PhysicalElement.AttachTo(PhysicalElement)
PhysicalElement.Detach()
PhysicalElement.Offset
PhysicalElement.GetWithinRange(Vector3, Single, String)
PhysicalElement.OnClicked
PhysicalElement.OnModelChange
PhysicalElement.OnStartSync
PhysicalElement.OnStopSync
PhysicalElement.OnStreamIn
PhysicalElement.OnStreamOut
Element.element
Element.Root
Element.MTAElement
Element.Type
Element.ID
Element.Exists
Element.ChildCount
Element.Parent
Element.CallPropagationEnabled
Element.SetData(String, Object, Boolean)
Element.GetData(String, Boolean)
Element.TryGetData(String, Object, Boolean)
Element.GetData<T>(String, Boolean)
Element.TryGetData<T>(String, T, Boolean)
Element.Destroy()
Element.GetChild(Int32)
Element.GetChildren(String)
Element.GetByID(String, Int32)
Element.ListenForEvent(String, Boolean, String)
Element.HandleEvent(String, MtaElement, Object, Object, Object, Object, Object, Object, Object, Object)
Element.OnDestroy
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Server.Peds
Assembly: SlipeServer.dll
Syntax
[DefaultElementClass(ElementType.Player)]
public class Player : Ped

Properties

| Improve this Doc View Source

Account

This function returns the specified player's account object.

Declaration
public Account Account { get; }
Property Value
Type Description
Account
| Improve this Doc View Source

Alive

Get an array of all alive players in the server

Declaration
public static Player[] Alive { get; }
Property Value
Type Description
Player[]
| Improve this Doc View Source

All

Get an array of all players in the server

Declaration
public static Player[] All { get; }
Property Value
Type Description
Player[]
| Improve this Doc View Source

BlurLevel

Get and set the motion blur level of the player

Declaration
public int BlurLevel { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Camera

Get the camera of the player

Declaration
public Camera Camera { get; }
Property Value
Type Description
Camera
| Improve this Doc View Source

Count

Get the total amount of players in the server

Declaration
public static int Count { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Dead

Get an array of all dead players in the server

Declaration
public static Player[] Dead { get; }
Property Value
Type Description
Player[]
| Improve this Doc View Source

ForceMap

Get and set if the player map forcefuly shows

Declaration
public bool ForceMap { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IdleTime

Get the amount of time in milliseconds that a players position has not changed.

Declaration
public int IdleTime { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

IP

Returns a string containing the IP address of the player.

Declaration
public string IP { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Money

Get and set the money of the player

Declaration
public int Money { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Muted

Get and set if the player is muted

Declaration
public bool Muted { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Name

Get and set the name of the player

Declaration
public string Name { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

NametagColor

Get and set the color of the player's nametag

Declaration
public Color NametagColor { get; set; }
Property Value
Type Description
Color
| Improve this Doc View Source

NametagShowing

Get and set wether the nametag is visible

Declaration
public bool NametagShowing { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

NametagText

This will change the text of a player's nickname in the world to something besides the nickname he chose. This will not change the player's actual nickname, it only changes the visible aspect inside the world

Declaration
public string NametagText { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

Ping

Get the ping in milliseconds

Declaration
public int Ping { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Random

Get a random player

Declaration
public static Player Random { get; }
Property Value
Type Description
Player
| Improve this Doc View Source

Serial

Get the serial of the player

Declaration
public string Serial { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Team

Get and set the team of the player

Declaration
public Team Team { get; set; }
Property Value
Type Description
Team
| Improve this Doc View Source

Version

This function gets the client version of the specified player as a sortable string.

Declaration
public string Version { get; }
Property Value
Type Description
String
| Improve this Doc View Source

WantedLevel

Get and set the wanted level of the player

Declaration
public int WantedLevel { get; set; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

DetonateSatchels()

Detonate the satchels this player has laid

Declaration
public bool DetonateSatchels()
Returns
Type Description
Boolean
| Improve this Doc View Source

GetAnnounceValue(String)

This function retrieves a players ASE announce value under a certain key.

Declaration
public string GetAnnounceValue(string key)
Parameters
Type Name Description
String key
Returns
Type Description
String
| Improve this Doc View Source

GetFromName(String)

Retrieves a player class instance from a specified player name

Declaration
public static Player GetFromName(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Player
| Improve this Doc View Source

GiveMoney(Int32)

Adds money to the player's money

Declaration
public bool GiveMoney(int amount)
Parameters
Type Name Description
Int32 amount
Returns
Type Description
Boolean
| Improve this Doc View Source

IsDisplayObserver(Display)

Check if this palyer can observe a certain display

Declaration
public bool IsDisplayObserver(Display display)
Parameters
Type Name Description
Display display
Returns
Type Description
Boolean
| Improve this Doc View Source

Kick(String, Player)

Kicks a player from the server

Declaration
public bool Kick(string reason, Player responsiblePlayer = null)
Parameters
Type Name Description
String reason
Player responsiblePlayer
Returns
Type Description
Boolean
| Improve this Doc View Source

Kick(String, String)

Kicks a player from the server

Declaration
public bool Kick(string reason, string responsiblePlayer = null)
Parameters
Type Name Description
String reason
String responsiblePlayer
Returns
Type Description
Boolean
| Improve this Doc View Source

Login(Account, String)

Logs the player into an account

Declaration
public bool Login(Account account, string password)
Parameters
Type Name Description
Account account
String password
Returns
Type Description
Boolean
| Improve this Doc View Source

LogOut()

Logs the player out of the account they're currently logged on

Declaration
public bool LogOut()
Returns
Type Description
Boolean
| Improve this Doc View Source

PlaySoundFrontEnd(FrontEndSound)

Play an internal GTA sound to this player

Declaration
public bool PlaySoundFrontEnd(FrontEndSound frontEndSound)
Parameters
Type Name Description
FrontEndSound frontEndSound
Returns
Type Description
Boolean
| Improve this Doc View Source

Redirect(String, Int32, String)

Redirects the player to a different server

Declaration
public bool Redirect(string serverIP, int serverPort = 0, string serverPassword = "")
Parameters
Type Name Description
String serverIP
Int32 serverPort
String serverPassword
Returns
Type Description
Boolean
| Improve this Doc View Source

ResendACInfo()

This function will force the specified player to resend their AC info, triggering the onPlayerACInfo event again.

Declaration
public bool ResendACInfo()
Returns
Type Description
Boolean
| Improve this Doc View Source

ResendModInfo()

This function will force the specified player to resend their mod info, triggering the onPlayerModInfo event again.

Declaration
public bool ResendModInfo()
Returns
Type Description
Boolean
| Improve this Doc View Source

SetAnnounceValue(String, String)

This function allows you to change ASE announce values for any player using a specified key. As an example this can be used to change the "score" value which will be shown at game-monitor.com's server list.

Declaration
public bool SetAnnounceValue(string key, string value)
Parameters
Type Name Description
String key
String value
Returns
Type Description
Boolean
| Improve this Doc View Source

SetHudComponentVisible(HudComponent, Boolean)

Set the visibility of a Hud component

Declaration
public bool SetHudComponentVisible(HudComponent component, bool visible)
Parameters
Type Name Description
HudComponent component
Boolean visible
Returns
Type Description
Boolean
| Improve this Doc View Source

SetVoiceBroadCastTo(Element[])

This function allows you to change who can hear the voice of a player.

Declaration
public bool SetVoiceBroadCastTo(Element[] targets)
Parameters
Type Name Description
Element[] targets
Returns
Type Description
Boolean
| Improve this Doc View Source

SetVoiceIgnoreFrom(Element[])

This function allows you to mute voices for a player

Declaration
public bool SetVoiceIgnoreFrom(Element[] targets)
Parameters
Type Name Description
Element[] targets
Returns
Type Description
Boolean
| Improve this Doc View Source

Spawn(Vector3, PedModel, Int32, Int32, Int32, Team)

Spawn the player at a certain position

Declaration
public void Spawn(Vector3 position, PedModel skin, int rotation = 0, int interior = 0, int dimension = 0, Team team = null)
Parameters
Type Name Description
Vector3 position
PedModel skin
Int32 rotation
Int32 interior
Int32 dimension
Team team
| Improve this Doc View Source

TakeMoney(Int32)

Substract money from the player

Declaration
public bool TakeMoney(int amount)
Parameters
Type Name Description
Int32 amount
Returns
Type Description
Boolean
| Improve this Doc View Source

TakeScreenShot(Vector2, String, Int32, Int32, Int32)

This function forces a client to capture the current screen output and send it back to the server. The image will contain the GTA HUD and the output of any dxDraw functions that are not flagged as 'post GUI'. The image specifically excludes the chat box and all GUI (including the client console). The result is received with the event onPlayerScreenShot.

Declaration
public bool TakeScreenShot(Vector2 dimensions, string tag = "", int quality = 30, int maxBandwith = 5000, int maxPacketSize = 500)
Parameters
Type Name Description
Vector2 dimensions
String tag
Int32 quality
Int32 maxBandwith
Int32 maxPacketSize
Returns
Type Description
Boolean

Events

| Improve this Doc View Source

OnAcInfo

Declaration
public event Player.OnAcInfoHandler OnAcInfo
Event Type
Type Description
Player.OnAcInfoHandler
| Improve this Doc View Source

OnBanAdded

Declaration
public event Player.OnBanAddedHandler OnBanAdded
Event Type
Type Description
Player.OnBanAddedHandler
| Improve this Doc View Source

OnBanned

Declaration
public event Player.OnBannedHandler OnBanned
Event Type
Type Description
Player.OnBannedHandler
| Improve this Doc View Source

OnChat

Declaration
public event Player.OnChatHandler OnChat
Event Type
Type Description
Player.OnChatHandler
| Improve this Doc View Source

OnClick

Declaration
public event Player.OnClickHandler OnClick
Event Type
Type Description
Player.OnClickHandler
| Improve this Doc View Source

OnCollisionShapeHit

Declaration
public event Player.OnCollisionShapeHitHandler OnCollisionShapeHit
Event Type
Type Description
Player.OnCollisionShapeHitHandler
| Improve this Doc View Source

OnCollisionShapeLeave

Declaration
public event Player.OnCollisionShapeLeaveHandler OnCollisionShapeLeave
Event Type
Type Description
Player.OnCollisionShapeLeaveHandler
| Improve this Doc View Source

OnCommand

Declaration
public event Player.OnCommandHandler OnCommand
Event Type
Type Description
Player.OnCommandHandler
| Improve this Doc View Source

OnConsole

Declaration
public event Player.OnConsoleHandler OnConsole
Event Type
Type Description
Player.OnConsoleHandler
| Improve this Doc View Source

OnContact

Declaration
public event Player.OnContactHandler OnContact
Event Type
Type Description
Player.OnContactHandler
| Improve this Doc View Source

OnDamage

Declaration
public event Player.OnDamageHandler OnDamage
Event Type
Type Description
Player.OnDamageHandler
| Improve this Doc View Source

OnJoin

Declaration
public static event Player.OnJoinHandler OnJoin
Event Type
Type Description
Player.OnJoinHandler
| Improve this Doc View Source

OnLogin

Declaration
public event Player.OnLoginHandler OnLogin
Event Type
Type Description
Player.OnLoginHandler
| Improve this Doc View Source

OnLogout

Declaration
public event Player.OnLogoutHandler OnLogout
Event Type
Type Description
Player.OnLogoutHandler
| Improve this Doc View Source

OnMarkerHit

Declaration
public event Player.OnMarkerHitHandler OnMarkerHit
Event Type
Type Description
Player.OnMarkerHitHandler
| Improve this Doc View Source

OnMarkerLeave

Declaration
public event Player.OnMarkerLeaveHandler OnMarkerLeave
Event Type
Type Description
Player.OnMarkerLeaveHandler
| Improve this Doc View Source

OnModInfo

Declaration
public event Player.OnModInfoHandler OnModInfo
Event Type
Type Description
Player.OnModInfoHandler
| Improve this Doc View Source

OnMuted

Declaration
public event Player.OnMutedHandler OnMuted
Event Type
Type Description
Player.OnMutedHandler
| Improve this Doc View Source

OnNetworkInteruption

Declaration
public event Player.OnNetworkInteruptionHandler OnNetworkInteruption
Event Type
Type Description
Player.OnNetworkInteruptionHandler
| Improve this Doc View Source

OnNicknameChanged

Declaration
public event Player.OnNicknameChangedHandler OnNicknameChanged
Event Type
Type Description
Player.OnNicknameChangedHandler
| Improve this Doc View Source

OnPickupHit

Declaration
public event Player.OnPickupHitHandler OnPickupHit
Event Type
Type Description
Player.OnPickupHitHandler
| Improve this Doc View Source

OnPickupLeave

Declaration
public event Player.OnPickupLeaveHandler OnPickupLeave
Event Type
Type Description
Player.OnPickupLeaveHandler
| Improve this Doc View Source

OnPickupUse

Declaration
public event Player.OnPickupUseHandler OnPickupUse
Event Type
Type Description
Player.OnPickupUseHandler
| Improve this Doc View Source

OnPrivateMessage

Declaration
public event Player.OnPrivateMessageHandler OnPrivateMessage
Event Type
Type Description
Player.OnPrivateMessageHandler
| Improve this Doc View Source

OnQuit

Declaration
public event Player.OnQuitHandler OnQuit
Event Type
Type Description
Player.OnQuitHandler
| Improve this Doc View Source

OnScreenShot

Declaration
public event Player.OnScreenShotHandler OnScreenShot
Event Type
Type Description
Player.OnScreenShotHandler
| Improve this Doc View Source

OnSpawn

Declaration
public event Player.OnSpawnHandler OnSpawn
Event Type
Type Description
Player.OnSpawnHandler
| Improve this Doc View Source

OnStealthKill

Declaration
public event Player.OnStealthKillHandler OnStealthKill
Event Type
Type Description
Player.OnStealthKillHandler
| Improve this Doc View Source

OnTarget

Declaration
public event Player.OnTargetHandler OnTarget
Event Type
Type Description
Player.OnTargetHandler
| Improve this Doc View Source

OnUnmuted

Declaration
public event Player.OnUnmutedHandler OnUnmuted
Event Type
Type Description
Player.OnUnmutedHandler
| Improve this Doc View Source

OnVehicleEnter

Declaration
public event Player.OnVehicleEnterHandler OnVehicleEnter
Event Type
Type Description
Player.OnVehicleEnterHandler
| Improve this Doc View Source

OnVehicleExit

Declaration
public event Player.OnVehicleExitHandler OnVehicleExit
Event Type
Type Description
Player.OnVehicleExitHandler
| Improve this Doc View Source

OnVoiceStart

Declaration
public event Player.OnVoiceStartHandler OnVoiceStart
Event Type
Type Description
Player.OnVoiceStartHandler
| Improve this Doc View Source

OnVoiceStop

Declaration
public event Player.OnVoiceStopHandler OnVoiceStop
Event Type
Type Description
Player.OnVoiceStopHandler
| Improve this Doc View Source

OnWeaponFire

Declaration
public event Player.OnWeaponFireHandler OnWeaponFire
Event Type
Type Description
Player.OnWeaponFireHandler

Extension Methods

ElementExtensions.SetVisibleTo(Element, Element, Boolean)
ElementExtensions.ClearVisibleTo(Element)
ElementExtensions.IsVisibleTo(Element, Element)
ElementExtensions.Clone(Element, Vector3)
ElementExtensions.GetZoneName(PhysicalElement, Boolean)
ElementExtensions.GetSyncer(PhysicalElement)
ElementExtensions.SetSyncer(PhysicalElement, Player)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX