Table of Contents

Class Player

Namespace
S1API.Entities
Assembly
S1API.dll

Represents a player within the game.

public class Player : IEntity, IHealth
Inheritance
Player
Implements
Inherited Members
Extension Methods

Fields

All

All players currently in the game.

public static readonly List<Player> All

Field Value

List<Player>

Properties

CrimeData

The player's crime data, including wanted level, crimes committed, and pursuit state.

public PlayerCrimeData CrimeData { get; }

Property Value

PlayerCrimeData

Crouched

Is player crouching

public bool Crouched { get; }

Property Value

bool

CurrentAvatarSettings

The player's current avatar settings (appearance configuration).

public object CurrentAvatarSettings { get; }

Property Value

object

CurrentHealth

The current health of the player.

public float CurrentHealth { get; }

Property Value

float

CurrentProperty

Property this player is currently in

public PropertyWrapper? CurrentProperty { get; }

Property Value

PropertyWrapper

CurrentRegion

Region this player is currently in

public Region CurrentRegion { get; }

Property Value

Region

IsArrested

If player is currently under arrest

public bool IsArrested { get; }

Property Value

bool

IsDead

Whether the player is dead or not.

public bool IsDead { get; }

Property Value

bool

IsInVehicle

If player is currently in a vehicle

public bool IsInVehicle { get; }

Property Value

bool

IsInvincible

Whether the player is invincible or not.

public bool IsInvincible { get; set; }

Property Value

bool

IsLocal

Whether this player is the client player or a networked player.

public bool IsLocal { get; }

Property Value

bool

IsRagdolled

Is Player currently ragdolled

public bool IsRagdolled { get; }

Property Value

bool

IsReadyToSleep

If player is ready for sleep

public bool IsReadyToSleep { get; }

Property Value

bool

IsSkating

If player is currently using a skateboard

public bool IsSkating { get; }

Property Value

bool

IsSleeping

If player is currently sleeping

public bool IsSleeping { get; }

Property Value

bool

IsTased

Is player currently under tased effect

public bool IsTased { get; }

Property Value

bool

IsUnconscious

If player is unconscious

public bool IsUnconscious { get; }

Property Value

bool

LastDrivenVehicle

The Last vehicle this player has driven

public LandVehicle? LastDrivenVehicle { get; }

Property Value

LandVehicle

LastVisitedProperty

Last Property this player visted (May only be owned properties)

public PropertyWrapper? LastVisitedProperty { get; }

Property Value

PropertyWrapper

Local

The current client player (player executing your code).

public static Player Local { get; }

Property Value

Player

MaxHealth

The maximum health of the player. Note: In the base game this is a constant (100). Changing it at runtime is unsupported. Setting this will clamp the player's current health to the specified value.

public float MaxHealth { get; set; }

Property Value

float

Name

The name of the player. For single player, this appears to always return Player.

public string Name { get; }

Property Value

string

Position

The world position of the player.

public Vector3 Position { get; set; }

Property Value

Vector3

Scale

The scale of the player.

public float Scale { get; set; }

Property Value

float

TimeSinceVehicleExit

Time since player has exited a vehicle

public float TimeSinceVehicleExit { get; }

Property Value

float

Transform

The transform of the player. Please do not set the properties of the Transform.

public Transform Transform { get; }

Property Value

Transform

Methods

Damage(int)

Deals damage to the player.

public void Damage(int amount)

Parameters

amount int

The amount of damage to deal.

EquipClothing(ClothingItemDefinition)

Creates clothing with the definition's default color and inserts it into the matching player clothing slot.

public ClothingItemInstance EquipClothing(ClothingItemDefinition definition)

Parameters

definition ClothingItemDefinition

The clothing item definition to equip.

Returns

ClothingItemInstance

The clothing instance that was inserted.

GetCurrentBasicAvatarSettings()

Retrieves the player's current avatar settings as an S1API BasicAvatarSettings wrapper. Returns a new BasicAvatarSettings instance on each call when S1Player.CurrentAvatarSettings is available.

public BasicAvatarSettings? GetCurrentBasicAvatarSettings()

Returns

BasicAvatarSettings

Heal(int)

Heals the player.

public void Heal(int amount)

Parameters

amount int

The amount of healing to apply to the player.

InsertClothing(ClothingItemInstance)

Inserts clothing into the matching player clothing slot.

public void InsertClothing(ClothingItemInstance clothing)

Parameters

clothing ClothingItemInstance

Kill()

Kills the player.

public void Kill()

RefreshClothingAppearance()

Refreshes the player's avatar from the current clothing slots.

public void RefreshClothingAppearance()

Revive()

Revives the player.

public void Revive()

SendAppearance(BasicAvatarSettings)

Sends updated appearance settings through the game's native appearance flow.

public void SendAppearance(BasicAvatarSettings settings)

Parameters

settings BasicAvatarSettings

Events

LocalPlayerSpawned

Fired when the local (client-owned) player finishes client startup.

public static event Action<Player>? LocalPlayerSpawned

Event Type

Action<Player>

OnDeath

Called when the player dies.

public event Action OnDeath

Event Type

Action

OnRevive

Called when the player revives.

public event Action OnRevive

Event Type

Action

PlayerDespawned

Fired when a player is destroyed/removed.

public static event Action<Player>? PlayerDespawned

Event Type

Action<Player>

PlayerSpawned

Fired when any player finishes client startup.

public static event Action<Player>? PlayerSpawned

Event Type

Action<Player>