Table of Contents

Class Player

Namespace
Exiled.API.Features
Assembly
Exiled.API.dll

Represents the in-game player, by encapsulating a ReferenceHub.

public class Player : TypeCastObject<Player>, IEntity, IWorldSpace, IPosition, IRotation
Inheritance
Player
Implements
Derived
Inherited Members
Extension Methods

Constructors

Player(ReferenceHub)

Initializes a new instance of the Player class.

public Player(ReferenceHub referenceHub)

Parameters

referenceHub ReferenceHub

The ReferenceHub of the player to be encapsulated.

Player(GameObject)

Initializes a new instance of the Player class.

public Player(GameObject gameObject)

Parameters

gameObject GameObject

The UnityEngine.GameObject of the player.

Properties

ActiveArtificialHealthProcesses

Gets a IEnumerable<T> of all active Artificial Health processes on the player.

public IEnumerable<AhpStat.AhpProcess> ActiveArtificialHealthProcesses { get; }

Property Value

IEnumerable<AhpStat.AhpProcess>

ActiveDangers

Gets a list of active CustomPlayerEffects.Danger.DangerStackBase the player has.

public IEnumerable<DangerStackBase> ActiveDangers { get; }

Property Value

IEnumerable<DangerStackBase>

ActiveEffects

Gets all currently active effects.

public IEnumerable<StatusEffectBase> ActiveEffects { get; }

Property Value

IEnumerable<StatusEffectBase>
See Also

AdminChatAccess

Gets a value indicating whether the player has Admin Chat access.

public bool AdminChatAccess { get; }

Property Value

bool

AgreedToRecording

Gets a value indicating whether the player has agreed to microphone recording.

public bool AgreedToRecording { get; }

Property Value

bool

Ammo

Gets the player's ammo.

public Dictionary<ItemType, ushort> Ammo { get; }

Property Value

Dictionary<ItemType, ushort>

ArtificialHealth

Gets or sets the player's artificial health. If the health is greater than the MaxArtificialHealth, it will also be changed to match the artificial health.

public float ArtificialHealth { get; set; }

Property Value

float

AuthenticationToken

Gets the player's authentication token.

public string AuthenticationToken { get; }

Property Value

string

AuthenticationType

Gets the player's authentication type.

public AuthenticationType AuthenticationType { get; }

Property Value

AuthenticationType

BadgeHidden

Gets or sets a value indicating whether the player's badge is hidden.

public bool BadgeHidden { get; set; }

Property Value

bool

CameraTransform

Gets the encapsulated ReferenceHub's PlayerCameraReference.

public Transform CameraTransform { get; }

Property Value

Transform

ComponentsInChildren

Gets a IReadOnlyCollection<T> of EActor containing all the components in children.

public IReadOnlyCollection<EActor> ComponentsInChildren { get; }

Property Value

IReadOnlyCollection<EActor>

Connection

Gets player's Mirror.NetworkConnection.

public NetworkConnection Connection { get; }

Property Value

NetworkConnection

Cuffer

Gets or sets a value indicating the Player that currently has the player cuffed.

This value will be null if the player is not cuffed. Setting this value to null will uncuff the player if they are cuffed.

public Player Cuffer { get; set; }

Property Value

Player

CurrentArmor

Gets the armor that the player is currently wearing. Value will be null if the player is not wearing any armor.

public Armor CurrentArmor { get; }

Property Value

Armor

CurrentHint

Gets the hint currently watched by the player.

public Hint CurrentHint { get; }

Property Value

Hint

CurrentItem

Gets or sets the item in the player's hand. Value will be null if the player is not holding anything.

public Item CurrentItem { get; set; }

Property Value

Item
See Also

CurrentRoom

Gets the current Room the player is in.

public Room CurrentRoom { get; }

Property Value

Room

CurrentSpectatingPlayers

Gets a Player IEnumerable<T> of spectators that are currently spectating this Player.

public IEnumerable<Player> CurrentSpectatingPlayers { get; }

Property Value

IEnumerable<Player>

CustomInfo

Gets or sets the player's custom player info string. This string is displayed along with the player's InfoArea.

public string CustomInfo { get; set; }

Property Value

string

CustomName

Gets or sets the player's nickname, if null it sets the original nickname.

public string CustomName { get; set; }

Property Value

string

CustomRoleFriendlyFireMultiplier

Gets or sets a Dictionary<TKey, TValue> containing cached string and their Dictionary<TKey, TValue> which is cached Role with FF multiplier. This is for unique custom roles.

public Dictionary<string, Dictionary<RoleTypeId, float>> CustomRoleFriendlyFireMultiplier { get; set; }

Property Value

Dictionary<string, Dictionary<RoleTypeId, float>>

Remarks

Consider adding this as object, Dict so that CustomRoles, and Strings can be parsed.

Dangers

Gets an array of CustomPlayerEffects.Danger.DangerStackBase if the Scp1853 effect is enabled or an empty array if it is not enabled.

public DangerStackBase[] Dangers { get; }

Property Value

DangerStackBase[]

Dictionary

Gets a Dictionary<TKey, TValue> containing all Player's on the server.

public static Dictionary<GameObject, Player> Dictionary { get; }

Property Value

Dictionary<GameObject, Player>

DisplayNickname

Gets or sets the player's nickname displayed to other player.

public string DisplayNickname { get; set; }

Property Value

string

DoNotTrack

Gets a value indicating whether the player has Do Not Track (DNT) enabled. If this value is true, data about the player unrelated to server security shouldn't be stored.

public bool DoNotTrack { get; }

Property Value

bool

Emotion

Gets or sets the player's emotion.

public EmotionPresetType Emotion { get; set; }

Property Value

EmotionPresetType

Footprint

Gets the player's Footprinting.Footprint.

public Footprint Footprint { get; }

Property Value

Footprint

FriendlyFireMultiplier

Gets or sets a Dictionary<TKey, TValue> containing cached PlayerRoles.RoleTypeId and their FF multiplier. This is for non-unique roles.

public Dictionary<RoleTypeId, float> FriendlyFireMultiplier { get; set; }

Property Value

Dictionary<RoleTypeId, float>

GameObject

Gets the encapsulated UnityEngine.GameObject.

public GameObject GameObject { get; }

Property Value

GameObject

GlobalBadge

Gets the global badge of the player. Value will be null if the player does not have a global badge.

public Badge? GlobalBadge { get; }

Property Value

Badge?

Group

Gets or sets the player's group.

public UserGroup Group { get; set; }

Property Value

UserGroup

GroupName

Gets or sets the player's group name.

public string GroupName { get; set; }

Property Value

string

HasCustomName

Gets a value indicating whether the player has an active CustomName.

public bool HasCustomName { get; }

Property Value

bool

HasFlashlightModuleEnabled

Gets a value indicating whether the player has enabled weapon's flashlight module.

public bool HasFlashlightModuleEnabled { get; }

Property Value

bool

HasHint

Gets a value indicating whether the player is viewing a hint.

public bool HasHint { get; }

Property Value

bool

HasReservedSlot

Gets a value indicating whether the player has a reserved slot.

public bool HasReservedSlot { get; }

Property Value

bool
See Also

Health

Gets or sets the player's health. If the health is greater than the MaxHealth, the MaxHealth will also be changed to match the health.

public float Health { get; set; }

Property Value

float

HintDisplay

Gets the Hints.HintDisplay of the player.

public HintDisplay HintDisplay { get; }

Property Value

HintDisplay

HumeShield

Gets or sets the player's Hume Shield.

public float HumeShield { get; set; }

Property Value

float

Remarks

This value can bypass the role's hume shield maximum. However, this value will only be visible to the end-player as Hume Shield if IsHumeShieldedRole is true. Otherwise, the game will treat the player as though they have the amount of Hume Shield specified, even though they cannot see it.

HumeShieldRegenerationMultiplier

Gets or sets the players multiplier for gaining HumeShield.

public float HumeShieldRegenerationMultiplier { get; set; }

Property Value

float

HumeShieldStat

Gets the player's PlayerStatsSystem.HumeShieldStat. TODO: Change to CustomHumeShieldStat.

public HumeShieldStat HumeShieldStat { get; }

Property Value

HumeShieldStat

IPAddress

Gets the player's IP address.

public string IPAddress { get; }

Property Value

string

Id

Gets or sets the player's id.

public int Id { get; set; }

Property Value

int

InfoArea

Gets or sets the player's player info area bitmask. This property can be used to hide player name elements, such as the player's name, badges, etc.

public PlayerInfoArea InfoArea { get; set; }

Property Value

PlayerInfoArea

InfoViewRange

Gets or sets the range at which this player's info can be viewed by others.

public float InfoViewRange { get; set; }

Property Value

float

Inventory

Gets the player's InventorySystem.Inventory.

public Inventory Inventory { get; }

Property Value

Inventory

IsAimingDownWeapon

Gets a value indicating whether the player is aiming with a weapon.

public bool IsAimingDownWeapon { get; }

Property Value

bool

IsAlive

Gets a value indicating whether the player is alive.

public bool IsAlive { get; }

Property Value

bool

IsBypassModeEnabled

Gets or sets a value indicating whether the player's bypass mode is enabled.

public bool IsBypassModeEnabled { get; set; }

Property Value

bool

IsCHI

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is any Chaos rank. Equivalent to checking the player's PlayerRoles.Team.

public bool IsCHI { get; }

Property Value

bool

IsConnected

Gets a value indicating whether the player is fully connected to the server.

public bool IsConnected { get; }

Property Value

bool

IsCuffed

Gets a value indicating whether the player is cuffed.

public bool IsCuffed { get; }

Property Value

bool

Remarks

Players can be cuffed without another player being the cuffer.

IsDead

Gets a value indicating whether the player is dead.

public bool IsDead { get; }

Property Value

bool

IsFoundationForces

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is any Foundation Forces. Equivalent to checking the player's PlayerRoles.Team.

public bool IsFoundationForces { get; }

Property Value

bool

IsFriendlyFireEnabled

Gets a value indicating whether the player's friendly fire is enabled.
This property only determines if this player can deal damage to players on the same team;

This player can be damaged by other players on their own team even if this property is false.

public bool IsFriendlyFireEnabled { get; }

Property Value

bool

IsGlobalModerator

Gets a value indicating whether the player is a global moderator.

public bool IsGlobalModerator { get; }

Property Value

bool

IsGlobalMuted

Gets or sets a value indicating whether the player is global muted.

public bool IsGlobalMuted { get; set; }

Property Value

bool

Remarks

This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(bool) and UnMute(bool).

IsGodModeEnabled

Gets or sets a value indicating whether the player has godmode enabled.

public bool IsGodModeEnabled { get; set; }

Property Value

bool

IsHost

Gets a value indicating whether the player is the host.

public bool IsHost { get; }

Property Value

bool

IsHuman

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is any human rank.

public bool IsHuman { get; }

Property Value

bool

IsInPocketDimension

Gets a value indicating whether the player is in the pocket dimension.

public bool IsInPocketDimension { get; }

Property Value

bool

IsIntercomMuted

Gets or sets a value indicating whether the player is intercom muted.

public bool IsIntercomMuted { get; set; }

Property Value

bool

Remarks

This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(bool) and UnMute(bool).

IsInventoryEmpty

Gets a value indicating whether the player's inventory is empty.

public bool IsInventoryEmpty { get; }

Property Value

bool

IsInventoryFull

Gets a value indicating whether the player's inventory is full.

public bool IsInventoryFull { get; }

Property Value

bool

IsJumping

Gets a value indicating whether the player is jumping.

public bool IsJumping { get; }

Property Value

bool

IsMuted

Gets or sets a value indicating whether the player is muted.

public bool IsMuted { get; set; }

Property Value

bool

Remarks

This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(bool) and UnMute(bool).

IsNPC

Gets a value indicating whether the player is a NPC.

public bool IsNPC { get; }

Property Value

bool

IsNTF

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is any NTF rank and not a Facility Guard. Equivalent to checking the player's PlayerRoles.Team.

public bool IsNTF { get; }

Property Value

bool

IsNoclipPermitted

Gets or sets a value indicating whether the player is allowed to enter noclip mode.

public bool IsNoclipPermitted { get; set; }

Property Value

bool

Remarks

For forcing the player into noclip mode, see IsNoclipEnabled.

See Also

IsNorthwoodStaff

Gets a value indicating whether the player is Northwood staff.

public bool IsNorthwoodStaff { get; }

Property Value

bool

IsOverwatchEnabled

Gets or sets a value indicating whether the player's overwatch is enabled.

public bool IsOverwatchEnabled { get; set; }

Property Value

bool

IsReloading

Gets a value indicating whether the player is reloading a weapon.

public bool IsReloading { get; }

Property Value

bool

IsScp

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is any SCP. Equivalent to checking the player's PlayerRoles.Team.

public bool IsScp { get; }

Property Value

bool

IsSpawnProtected

Gets or sets a value indicating whether the player is spawn protected.

public bool IsSpawnProtected { get; set; }

Property Value

bool

IsSpeaking

Gets a value indicating whether the player is speaking.

public bool IsSpeaking { get; }

Property Value

bool

IsStaffBypassEnabled

Gets a value indicating whether the staff bypass is enabled.

public bool IsStaffBypassEnabled { get; }

Property Value

bool

IsTransmitting

Gets a value indicating whether the player is transmitting on a Radio.

public bool IsTransmitting { get; }

Property Value

bool

IsTutorial

Gets a value indicating whether the player's PlayerRoles.RoleTypeId is equal to PlayerRoles.RoleTypeId.Tutorial.

public bool IsTutorial { get; }

Property Value

bool

IsUsingStamina

Gets or sets a value indicating whether the player should use stamina system.

public bool IsUsingStamina { get; set; }

Property Value

bool

IsVerified

Gets a value indicating whether the player is verified.

public bool IsVerified { get; }

Property Value

bool

Remarks

This is always false if online_mode is set to false.

IsWhitelisted

Gets a value indicating whether the player is in whitelist.

public bool IsWhitelisted { get; }

Property Value

bool

Remarks

It will always return true if a whitelist is disabled on the server.

See Also

Items

Gets the player's items.

public IReadOnlyCollection<Item> Items { get; }

Property Value

IReadOnlyCollection<Item>

KickPower

Gets a value indicating a player's kick power.

public byte KickPower { get; }

Property Value

byte

LeadingTeam

Gets the player's LeadingTeam.

public LeadingTeam LeadingTeam { get; }

Property Value

LeadingTeam

Lift

Gets the current Lift the player is in. Can be null.

public Lift Lift { get; }

Property Value

Lift

List

Gets a list of all Player's on the server.

public static IReadOnlyCollection<Player> List { get; }

Property Value

IReadOnlyCollection<Player>

MaxArtificialHealth

Gets or sets the player's maximum artificial health.

public float MaxArtificialHealth { get; set; }

Property Value

float

MaxHealth

Gets or sets the player's maximum health.

public float MaxHealth { get; set; }

Property Value

float

MaxHumeShield

Gets or sets the players maximum Hume Shield.

public float MaxHumeShield { get; set; }

Property Value

float

NetId

Gets the player's net ID.

public uint NetId { get; }

Property Value

uint

NetworkIdentity

Gets the player's Mirror.NetworkIdentity.

public NetworkIdentity NetworkIdentity { get; }

Property Value

NetworkIdentity

Nickname

Gets the player's nickname.

public string Nickname { get; }

Property Value

string

Ping

Gets the player's ping.

public int Ping { get; }

Property Value

int

Position

Gets or sets the player's position.

public virtual Vector3 Position { get; set; }

Property Value

Vector3
See Also

Preferences

Gets a Dictionary<TKey, TValue> which contains all player's preferences.

public Dictionary<FirearmType, AttachmentIdentifier[]> Preferences { get; }

Property Value

Dictionary<FirearmType, AttachmentIdentifier[]>

PreviousRole

Gets the role that player had before changing role.

public RoleTypeId PreviousRole { get; }

Property Value

RoleTypeId

RadioPlayback

Gets the ReferenceHub's VoiceChat.Playbacks.PersonalRadioPlayback, can be null.

public PersonalRadioPlayback RadioPlayback { get; }

Property Value

PersonalRadioPlayback

RankColor

Gets or sets the player's rank color.

public string RankColor { get; set; }

Property Value

string

RankName

Gets or sets the player's rank name.

public string RankName { get; set; }

Property Value

string

RawUserId

Gets the player's user id without the authentication.

public string RawUserId { get; }

Property Value

string

ReferenceHub

Gets the encapsulated ReferenceHub.

public ReferenceHub ReferenceHub { get; }

Property Value

ReferenceHub

RelativePosition

Gets or sets the relative player's position.

public RelativePosition RelativePosition { get; set; }

Property Value

RelativePosition

Remarks

The value will be default if the player's role is not an FpcRole.

RemoteAdminAccess

Gets a value indicating whether the player has Remote Admin access.

public bool RemoteAdminAccess { get; }

Property Value

bool

RemoteAdminPermissions

Gets or sets a value indicating the actual RA permissions.

public PlayerPermissions RemoteAdminPermissions { get; set; }

Property Value

PlayerPermissions

Role

Gets a Role that is unique to this player and this class. This allows modification of various aspects related to the role solely.

The type of the Role is different based on the PlayerRoles.RoleTypeId of the player, and casting should be used to modify the role.
PlayerRoles.RoleTypeId.Spectator = SpectatorRole.
PlayerRoles.RoleTypeId.Overwatch = OverwatchRole.
PlayerRoles.RoleTypeId.None = NoneRole.
PlayerRoles.RoleTypeId.Scp049 = Scp049Role.
PlayerRoles.RoleTypeId.Scp0492 = Scp0492Role.
PlayerRoles.RoleTypeId.Scp079 = Scp079Role.
PlayerRoles.RoleTypeId.Scp096 = Scp096Role.
PlayerRoles.RoleTypeId.Scp106 = Scp106Role.
PlayerRoles.RoleTypeId.Scp173 = Scp173Role.
PlayerRoles.RoleTypeId.Scp3114 = Scp3114Role.
PlayerRoles.RoleTypeId.Scp939 = Scp939Role.
If not listed above, the type of Role will be HumanRole.

If the role object is stored, it may become invalid if the player changes roles. Thus, the IsValid property can be checked. If this property is false, the role should be discarded and this property should be used again to get the new Role. This role is automatically cached until it changes, and it is recommended to use this property directly rather than storing the property yourself.

Roles and RoleTypeIds can be compared directly. Player.Role == RoleTypeId.Scp079 is valid and will return true if the player is SCP-079. To set the player's role, see Set(RoleTypeId, SpawnReason, RoleSpawnFlags).

public Role Role { get; }

Property Value

Role
See Also
Set(RoleTypeId, SpawnReason, RoleSpawnFlags)

RoleManager

Gets the PlayerRoles.PlayerRoleManager.

public PlayerRoleManager RoleManager { get; }

Property Value

PlayerRoleManager

Rotation

Gets or sets the player's rotation.

public Quaternion Rotation { get; set; }

Property Value

Quaternion

Returns the direction the player is looking at.

Scale

Gets or sets the player's scale.

public Vector3 Scale { get; set; }

Property Value

Vector3

ScpPreferences

Gets or sets the player's SCP preferences.

public ScpSpawnPreferences.SpawnPreferences ScpPreferences { get; set; }

Property Value

ScpSpawnPreferences.SpawnPreferences

Sender

Gets the player's command sender instance.

public PlayerCommandSender Sender { get; }

Property Value

PlayerCommandSender

SessionVariables

Gets the dictionary of the player's session variables.

Session variables can be used to save temporary data on players. Data is stored in a Dictionary<TKey, TValue>. The key of the data is always a string, whereas the value can be any object. The data stored in a player's session variables can be accessed by different assemblies; it is recommended to uniquely identify stored data so that it does not conflict with other plugins that may also be using the same name. Data saved with session variables is not being saved on player disconnect. If the data must be saved after the player's disconnects, a database must be used instead.

public Dictionary<string, object> SessionVariables { get; }

Property Value

Dictionary<string, object>

Stamina

Gets or sets the amount of stamina the player has.

public float Stamina { get; set; }

Property Value

float

Remarks

This will always be a value between 0-1, 0 representing no stamina and 1 representing maximum stamina.

StaminaStat

Gets the StaminaStat class.

public StaminaStat StaminaStat { get; }

Property Value

StaminaStat

Transform

Gets the ReferenceHub's UnityEngine.Transform.

public Transform Transform { get; }

Property Value

Transform

UniqueRole

Gets or sets a unique custom role that does not abide to base game for this player. Used in conjunction with CustomRoleFriendlyFireMultiplier.

public string UniqueRole { get; set; }

Property Value

string

UnitId

Gets or sets the player's unit id.

public byte UnitId { get; set; }

Property Value

byte

UnitName

Gets the player's unit name.

public string UnitName { get; }

Property Value

string

UserId

Gets the player's user id.

public string UserId { get; }

Property Value

string

UserIdsCache

Gets a Dictionary<TKey, TValue> containing cached Player and their user ids.

public static Dictionary<string, Player> UserIdsCache { get; }

Property Value

Dictionary<string, Player>

Velocity

Gets the Player's current movement speed.

public Vector3 Velocity { get; }

Property Value

Vector3

VoiceChannel

Gets or sets the player's voice channel.

public VoiceChatChannel VoiceChannel { get; set; }

Property Value

VoiceChatChannel

VoiceChatMuteFlags

Gets or sets the player's VoiceChat.VcMuteFlags.

public VcMuteFlags VoiceChatMuteFlags { get; set; }

Property Value

VcMuteFlags

VoiceColor

Gets the player's voice color.

public Color VoiceColor { get; }

Property Value

Color

Zone

Gets the current zone the player is in.

public ZoneType Zone { get; }

Property Value

ZoneType

Methods

AddAhp(float, float, float, float, float, bool)

Gives a new to the player.

public void AddAhp(float amount, float limit = 75, float decay = 1.2, float efficacy = 0.7, float sustain = 0, bool persistant = false)

Parameters

amount float

The amount to give the player.

limit float

The maximum AHP for this stat.

decay float

How much value is lost per second.

efficacy float

Percent of incoming damage absorbed by this stat.

sustain float

The number of seconds to delay the start of the decay.

persistant bool

Whether the process is removed when the value hits 0.

AddAmmo(AmmoType, ushort)

Adds the amount of a specified ammo type to the player's inventory.

public void AddAmmo(AmmoType ammoType, ushort amount)

Parameters

ammoType AmmoType

The AmmoType to be added.

amount ushort

The amount of ammo to be added.

AddAmmo(FirearmType, ushort)

Adds the amount of a weapon's ammo type to the player's inventory.

public void AddAmmo(FirearmType weaponType, ushort amount)

Parameters

weaponType FirearmType

The ItemType of the weapon.

amount ushort

The amount of ammo to be added.

AddAmmo(Dictionary<AmmoType, ushort>)

Adds the amount of a specified ammo type to player's inventory.

public void AddAmmo(Dictionary<AmmoType, ushort> ammoBag)

Parameters

ammoBag Dictionary<AmmoType, ushort>

A dictionary of ammo types that will be added.

AddAmmo(Dictionary<ItemType, ushort>)

Adds the amount of a specified ammo to player's inventory.

public void AddAmmo(Dictionary<ItemType, ushort> ammo)

Parameters

ammo Dictionary<ItemType, ushort>

A dictionary of ItemType and ushort of ammo and amount.

AddComponent(Type, string)

Adds a component to the IEntity.

public EActor AddComponent(Type type, string name = "")

Parameters

type Type

The Type of the EActor to be added.

name string

The name of the component.

Returns

EActor

The added EActor component.

AddComponent<T>(string)

Adds a component to the IEntity.

public T AddComponent<T>(string name = "") where T : EActor

Parameters

name string

The name of the component.

Returns

T

The added EActor component.

Type Parameters

T

The T EActor to be added.

AddComponent<T>(Type, string)

Adds a component from the IEntity.

public T AddComponent<T>(Type type, string name = "") where T : EActor

Parameters

type Type

The Type of the EActor to be added.

name string

The name of the component.

Returns

T

The added EActor component.

Type Parameters

T

The T cast EActor type.

AddItem(FirearmType, IEnumerable<AttachmentIdentifier>)

Adds an firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public Item AddItem(FirearmType firearmType, IEnumerable<AttachmentIdentifier> identifiers)

Parameters

firearmType FirearmType

The firearm to be added.

identifiers IEnumerable<AttachmentIdentifier>

The attachments to be added to the item.

Returns

Item

The Item given to the player.

AddItem(FirearmType, int, IEnumerable<AttachmentIdentifier>)

Adds the amount of firearms of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public IEnumerable<Item> AddItem(FirearmType firearmType, int amount, IEnumerable<AttachmentIdentifier> identifiers)

Parameters

firearmType FirearmType

The item to be added.

amount int

The amount of items to be added.

identifiers IEnumerable<AttachmentIdentifier>

The attachments to be added to the item.

Returns

IEnumerable<Item>

An IEnumerable<T> containing the items given.

AddItem(Firearm, IEnumerable<AttachmentIdentifier>)

Adds an item to the player's inventory.

public void AddItem(Firearm item, IEnumerable<AttachmentIdentifier> identifiers)

Parameters

item Firearm

The item to be added.

identifiers IEnumerable<AttachmentIdentifier>

The attachments to be added to the item.

AddItem(Item)

Adds an item to the player's inventory.

public void AddItem(Item item)

Parameters

item Item

The item to be added.

AddItem(FirearmPickup, IEnumerable<AttachmentIdentifier>)

Adds an item to the player's inventory.

public Item AddItem(FirearmPickup pickup, IEnumerable<AttachmentIdentifier> identifiers)

Parameters

pickup FirearmPickup

The FirearmPickup of the item to be added.

identifiers IEnumerable<AttachmentIdentifier>

The attachments to be added to Pickup of the item.

Returns

Item

The Item that was added.

AddItem(Pickup, ItemAddReason)

Adds an item to the player's inventory.

public Item AddItem(Pickup pickup, ItemAddReason addReason = ItemAddReason.AdminCommand)

Parameters

pickup Pickup

The Pickup of the item to be added.

addReason ItemAddReason

The reason the item was added.

Returns

Item

The Item that was added.

AddItem(ItemBase, Item, ItemAddReason)

Adds an item to the player's inventory.

public Item AddItem(ItemBase itemBase, Item item = null, ItemAddReason addReason = ItemAddReason.AdminCommand)

Parameters

itemBase ItemBase

The item to be added.

item Item

The Item object of the item.

addReason ItemAddReason

The reason the item was added.

Returns

Item

The Item that was added.

AddItem(ItemType)

Adds an item of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public Item AddItem(ItemType itemType)

Parameters

itemType ItemType

The item to be added.

Returns

Item

The Item given to the player.

AddItem(ItemType, int)

Adds the amount of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public IEnumerable<Item> AddItem(ItemType itemType, int amount)

Parameters

itemType ItemType

The item to be added.

amount int

The amount of items to be added.

Returns

IEnumerable<Item>

An IEnumerable<T> containing the items given.

AddItem(Dictionary<FirearmType, IEnumerable<AttachmentIdentifier>>)

Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public IEnumerable<Item> AddItem(Dictionary<FirearmType, IEnumerable<AttachmentIdentifier>> items)

Parameters

items Dictionary<FirearmType, IEnumerable<AttachmentIdentifier>>

The Dictionary<TKey, TValue> of ItemType and IEnumerable<T> of AttachmentIdentifier to be added.

Returns

IEnumerable<Item>

An IEnumerable<T> containing the items given.

AddItem(Dictionary<Firearm, IEnumerable<AttachmentIdentifier>>)

Adds the list of items to the player's inventory.

public void AddItem(Dictionary<Firearm, IEnumerable<AttachmentIdentifier>> firearms)

Parameters

firearms Dictionary<Firearm, IEnumerable<AttachmentIdentifier>>

The Dictionary<TKey, TValue> of Firearm and IEnumerable<T> of AttachmentIdentifier to be added.

AddItem(IEnumerable<Item>)

Adds the list of items to the player's inventory.

public void AddItem(IEnumerable<Item> items)

Parameters

items IEnumerable<Item>

The list of items to be added.

AddItem(IEnumerable<ItemType>)

Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.

public IEnumerable<Item> AddItem(IEnumerable<ItemType> items)

Parameters

items IEnumerable<ItemType>

The list of items to be added.

Returns

IEnumerable<Item>

An IEnumerable<T> containing the items given.

AddReservedSlot(string, bool)

Adds a player's UserId to the list of reserved slots.

public static bool AddReservedSlot(string userId, bool isPermanent)

Parameters

userId string

The UserId of the player to add.

isPermanent bool

Whether to add a userId permanently. It will write a userId to UserIDReservedSlots.txt file.

Returns

bool

true if the slot was successfully added, or false if the provided UserId already has a reserved slot.

See Also

AddToWhitelist(string, bool)

Adds a player's UserId to the whitelist.

public static bool AddToWhitelist(string userId, bool isPermanent)

Parameters

userId string

The UserId of the player to add.

isPermanent bool

Whether to add a userId permanently. It will write a userId to UserIDWhitelist.txt file.

Returns

bool

true if the record was successfully added, or false if the provided UserId already is in whitelist.

See Also

ApplyRandomEffect(EffectCategory, byte, float, bool)

Enables a random EffectType on the player.

public EffectType ApplyRandomEffect(EffectCategory category, byte intensity, float duration = 0, bool addDurationIfActive = false)

Parameters

category EffectCategory

An optional category to filter the applied effect. Set to None for any effect.

intensity byte

The intensity of the effect will be active for.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

EffectType

A EffectType that was given to the player.

ApplyRandomEffect(EffectCategory, float, bool)

Enables a random EffectType on the player.

public EffectType ApplyRandomEffect(EffectCategory category = EffectCategory.None, float duration = 0, bool addDurationIfActive = false)

Parameters

category EffectCategory

An optional category to filter the applied effect. Set to None for any effect.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

EffectType

A EffectType that was given to the player.

Ban(int, string, Player)

Bans the player.

public void Ban(int duration, string reason, Player issuer = null)

Parameters

duration int

The ban duration, in seconds.

reason string

The ban reason.

issuer Player

The ban issuer.

Ban(TimeSpan, string, Player)

Bans the player.

public void Ban(TimeSpan duration, string reason, Player issuer = null)

Parameters

duration TimeSpan

The length of time to ban.

reason string

The ban reason.

issuer Player

The ban issuer.

BlinkTag()

Blink the player's tag.

public IEnumerator<float> BlinkTag()

Returns

IEnumerator<float>

Used to wait.

Broadcast(Broadcast, bool)

Broadcasts the given Broadcast to the player.

public void Broadcast(Broadcast broadcast, bool shouldClearPrevious = false)

Parameters

broadcast Broadcast

The Broadcast to be broadcasted.

shouldClearPrevious bool

Clears all player's broadcasts before sending the new one.

Broadcast(ushort, string, BroadcastFlags, bool)

Shows a broadcast to the player. Doesn't get logged to the console and can be monospaced.

public void Broadcast(ushort duration, string message, Broadcast.BroadcastFlags type = BroadcastFlags.Normal, bool shouldClearPrevious = false)

Parameters

duration ushort

The broadcast duration.

message string

The message to be broadcasted.

type Broadcast.BroadcastFlags

The broadcast type.

shouldClearPrevious bool

Clears all player's broadcasts before sending the new one.

ChangeEffectIntensity(EffectType, byte, float)

Changes the intensity of a CustomPlayerEffects.StatusEffectBase.

public void ChangeEffectIntensity(EffectType type, byte intensity, float duration = 0)

Parameters

type EffectType

The EffectType to change.

intensity byte

The new intensity to use.

duration float

The new duration to add to the effect.

ChangeEffectIntensity(string, byte, float)

Changes the intensity of a status effect.

public void ChangeEffectIntensity(string effectName, byte intensity, float duration = 0)

Parameters

effectName string

The name of the CustomPlayerEffects.StatusEffectBase to enable.

intensity byte

The intensity of the effect.

duration float

The new length of the effect. Defaults to infinite length.

ChangeEffectIntensity<T>(byte, float)

Changes the intensity of a status effect.

public void ChangeEffectIntensity<T>(byte intensity, float duration = 0) where T : StatusEffectBase

Parameters

intensity byte

The intensity of the effect.

duration float

The new duration to add to the effect.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to change the intensity of.

ClearAmmo()

Clears all ammo in the inventory.

public void ClearAmmo()
See Also

ClearBroadcasts()

Clears the player's brodcast. Doesn't get logged to the console.

public void ClearBroadcasts()

ClearInventory(bool)

Clears the player's inventory, including all ammo and items.

public void ClearInventory(bool destroy = true)

Parameters

destroy bool

Whether to fully destroy the old items.

See Also

ClearItems(bool)

Clears the player's items.

public void ClearItems(bool destroy = true)

Parameters

destroy bool

Whether to fully destroy the old items.

See Also

CountItem(ProjectileType)

Counts how many items of a certain ProjectileType a player has.

public int CountItem(ProjectileType grenadeType)

Parameters

grenadeType ProjectileType

The ProjectileType to search for.

Returns

int

How many items of that ProjectileType the player has.

See Also

CountItem(ItemCategory)

Counts how many items of a certain ItemCategory a player has.

public int CountItem(ItemCategory category)

Parameters

category ItemCategory

The category to search for.

Returns

int

How many items of that ItemCategory the player has.

See Also

CountItem(ItemType)

Counts how many items of a certain ItemType a player has.

public int CountItem(ItemType item)

Parameters

item ItemType

The item to search for.

Returns

int

How many items of that ItemType the player has.

Remarks

For counting ammo, see GetAmmo(AmmoType).

See Also

DisableAllEffects()

Disables all currently active status effects.

public void DisableAllEffects()
See Also

DisableAllEffects(EffectCategory)

Disables all currently active status effects.

public void DisableAllEffects(EffectCategory category)

Parameters

category EffectCategory

A category to filter the disabled effects.

See Also

DisableEffect(EffectType)

Disables a specific status effect on the player.

public void DisableEffect(EffectType effect)

Parameters

effect EffectType

The EffectType to disable.

DisableEffect<T>()

Disables a specific status effect on the player.

public void DisableEffect<T>() where T : StatusEffectBase

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to disable.

DisableEffects(IEnumerable<EffectType>)

Disables a IEnumerable<T> of EffectType on the player.

public void DisableEffects(IEnumerable<EffectType> effects)

Parameters

effects IEnumerable<EffectType>

The IEnumerable<T> of EffectType to disable.

Disconnect(string)

Disconnects the player.

public void Disconnect(string reason = null)

Parameters

reason string

The disconnection reason.

DropAmmo(AmmoType, ushort, bool)

Drops a specific AmmoType out of the player's inventory.

public bool DropAmmo(AmmoType ammoType, ushort amount, bool checkMinimals = false)

Parameters

ammoType AmmoType

The AmmoType that will be dropped.

amount ushort

The amount of ammo that will be dropped.

checkMinimals bool

Whether ammo limits will be taken into consideration.

Returns

bool

true if ammo was dropped; otherwise, false.

DropHeldItem()

Drops the held item. Will not do anything if the player is not holding an item.

public Pickup DropHeldItem()

Returns

Pickup

Dropped item's Pickup.

See Also

DropHeldItem(bool)

Drops the held item. Will not do anything if the player is not holding an item.

public void DropHeldItem(bool isThrown = false)

Parameters

isThrown bool

Is the item Thrown?.

DropItem(Item)

Drops an item from the player's inventory.

public Pickup DropItem(Item item)

Parameters

item Item

The Item to be dropped.

Returns

Pickup

dropped Pickup.

DropItem(Item, bool)

Drops an item from the player's inventory.

public void DropItem(Item item, bool isThrown = false)

Parameters

item Item

The Item to be dropped.

isThrown bool

Is the item Thrown?.

DropItems()

Drops all items in the player's inventory, including all ammo and items.

public void DropItems()
See Also

EnableEffect(StatusEffectBase, byte, float, bool)

Enables a status effect on the player.

public bool EnableEffect(StatusEffectBase statusEffect, byte intensity, float duration = 0, bool addDurationIfActive = false)

Parameters

statusEffect StatusEffectBase

The name of the CustomPlayerEffects.StatusEffectBase to enable.

intensity byte

The intensity of the effect will be active for.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

bool

A bool indicating whether the effect was valid and successfully enabled.

EnableEffect(StatusEffectBase, float, bool)

Enables a status effect on the player.

public bool EnableEffect(StatusEffectBase statusEffect, float duration = 0, bool addDurationIfActive = false)

Parameters

statusEffect StatusEffectBase

The name of the CustomPlayerEffects.StatusEffectBase to enable.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

bool

A bool indicating whether the effect was valid and successfully enabled.

EnableEffect(EffectType, byte, float, bool)

Enables a status effect on the player.

public bool EnableEffect(EffectType type, byte intensity, float duration = 0, bool addDurationIfActive = false)

Parameters

type EffectType

The EffectType to enable.

intensity byte

The intensity of the effect will be active for.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

bool

A bool indicating whether the effect was valid and successfully enabled.

EnableEffect(EffectType, float, bool)

Enables a status effect on the player.

public void EnableEffect(EffectType type, float duration = 0, bool addDurationIfActive = false)

Parameters

type EffectType

The EffectType to enable.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

EnableEffect(string, byte, float, bool)

Enables a status effect on the player.

public StatusEffectBase EnableEffect(string effectName, byte intensity, float duration = 0, bool addDurationIfActive = false)

Parameters

effectName string

The name of the CustomPlayerEffects.StatusEffectBase to enable.

intensity byte

The intensity of the effect will be active for.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

StatusEffectBase

The CustomPlayerEffects.StatusEffectBase instance of the activated effect.

EnableEffect(string, float, bool)

Enables a status effect on the player.

public StatusEffectBase EnableEffect(string effectName, float duration = 0, bool addDurationIfActive = false)

Parameters

effectName string

The name of the CustomPlayerEffects.StatusEffectBase to enable.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

StatusEffectBase

The CustomPlayerEffects.StatusEffectBase instance of the activated effect.

EnableEffect<T>(byte, float, bool)

Enables a status effect on the player.

public bool EnableEffect<T>(byte intensity, float duration = 0, bool addDurationIfActive = false) where T : StatusEffectBase

Parameters

intensity byte

The intensity of the effect will be active for.

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

bool

A bool indicating whether the effect was valid and successfully enabled.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to enable.

EnableEffect<T>(float, bool)

Enables a status effect on the player.

public bool EnableEffect<T>(float duration = 0, bool addDurationIfActive = false) where T : StatusEffectBase

Parameters

duration float

The amount of time the effect will be active for.

addDurationIfActive bool

If the effect is already active, setting to true will add this duration onto the effect.

Returns

bool

A bool indicating whether the effect was valid and successfully enabled.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to enable.

EnableEffects(IEnumerable<EffectType>, float, bool)

Enables a IEnumerable<T> of EffectType on the player.

public void EnableEffects(IEnumerable<EffectType> types, float duration = 0, bool addDurationIfActive = false)

Parameters

types IEnumerable<EffectType>

The IEnumerable<T> of EffectType to enable.

duration float

The amount of time the effects will be active for.

addDurationIfActive bool

If an effect is already active, setting to true will add this duration onto the effect.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Explode()

Explode the player.

public void Explode()

Explode(ProjectileType, Player)

Explode the player.

public void Explode(ProjectileType projectileType, Player attacker = null)

Parameters

projectileType ProjectileType

The projectile that will create the explosion.

attacker Player

The Player that will causing the explosion.

ExplodeEffect(ProjectileType)

Spawn projectile effect on the player.

public void ExplodeEffect(ProjectileType projectileType)

Parameters

projectileType ProjectileType

The projectile that will create the effect.

~Player()

Finalizes an instance of the Player class.

protected ~Player()

Get(CommandSender)

Gets the Player belonging to the CommandSender, if any.

public static Player Get(CommandSender sender)

Parameters

sender CommandSender

The command sender.

Returns

Player

A Player or null if not found.

Get(ICommandSender)

Gets the Player belonging to the CommandSystem.ICommandSender, if any.

public static Player Get(ICommandSender sender)

Parameters

sender ICommandSender

The command sender.

Returns

Player

A Player or null if not found.

Get(Side)

Gets a Player IEnumerable<T> filtered by side. Can be empty.

public static IEnumerable<Player> Get(Side side)

Parameters

side Side

The players' side.

Returns

IEnumerable<Player>

The filtered IEnumerable<T>.

Get(Footprint)

Gets the Player belonging to the Footprinting.Footprint, if any.

public static Player Get(Footprint footprint)

Parameters

footprint Footprint

The Footprint.

Returns

Player

A Player or null if not found.

Get(NetworkConnection)

Gets the Player belonging to a specific Mirror.NetworkConnection, if any.

public static Player Get(NetworkConnection conn)

Parameters

conn NetworkConnection

The player's Mirror.NetworkConnection.

Returns

Player

The Player owning the Mirror.NetworkConnection, or null if not found.

Get(NetworkIdentity)

Gets the Player belonging to a specific Mirror.NetworkIdentity, if any.

public static Player Get(NetworkIdentity netIdentity)

Parameters

netIdentity NetworkIdentity

The player's Mirror.NetworkIdentity.

Returns

Player

The Player owning the Mirror.NetworkIdentity, or null if not found.

Get(RoleTypeId)

Gets a Player IEnumerable<T> filtered by role. Can be empty.

public static IEnumerable<Player> Get(RoleTypeId role)

Parameters

role RoleTypeId

The players' role.

Returns

IEnumerable<Player>

The filtered IEnumerable<T>.

Get(Team)

Gets a Player IEnumerable<T> filtered by team. Can be empty.

public static IEnumerable<Player> Get(Team team)

Parameters

team Team

The players' team.

Returns

IEnumerable<Player>

The filtered IEnumerable<T>.

Get(Player)

Gets the Player from NwPluginAPI class.

public static Player Get(Player apiPlayer)

Parameters

apiPlayer Player

The PluginAPI.Core.Player class.

Returns

Player

A Player or null if not found.

Get(ReferenceHub)

Gets the Player belonging to the ReferenceHub, if any.

public static Player Get(ReferenceHub referenceHub)

Parameters

referenceHub ReferenceHub

The player's ReferenceHub.

Returns

Player

A Player or null if not found.

Get(Func<Player, bool>)

Gets a IEnumerable<T> of Player filtered based on a predicate.

public static IEnumerable<Player> Get(Func<Player, bool> predicate)

Parameters

predicate Func<Player, bool>

The condition to satisfy.

Returns

IEnumerable<Player>

A IEnumerable<T> of Player which contains elements that satisfy the condition.

Get(int)

Gets the player belonging to the specified id.

public static Player Get(int id)

Parameters

id int

The player id.

Returns

Player

Returns the player found or null if not found.

Get(string)

Gets the Player by identifier.

public static Player Get(string args)

Parameters

args string

The player's nickname, ID, steamID64 or Discord ID.

Returns

Player

Returns the player found or null if not found.

Get(uint)

Gets the Player belonging to a specific netId, if any.

public static Player Get(uint netId)

Parameters

netId uint

The player's Mirror.NetworkIdentity.netId.

Returns

Player

The Player owning the netId, or null if not found.

Get(Collider)

Gets the Player belonging to the UnityEngine.Collider, if any.

public static Player Get(Collider collider)

Parameters

collider Collider

UnityEngine.Collider.

Returns

Player

A Player or null if not found.

Get(GameObject)

Gets the Player belonging to the UnityEngine.GameObject, if any.

public static Player Get(GameObject gameObject)

Parameters

gameObject GameObject

The player's UnityEngine.GameObject.

Returns

Player

A Player or null if not found.

GetAmmo(AmmoType)

Gets the ammo count of a specified ammo type in a player's inventory.

public ushort GetAmmo(AmmoType ammoType)

Parameters

ammoType AmmoType

The AmmoType to be searched for in the player's inventory.

Returns

ushort

The specified ammo count.

GetAmmoLimit(AmmoType, bool)

Gets the maximum amount of ammo the player can hold, given the ammo AmmoType.

public ushort GetAmmoLimit(AmmoType type, bool ignoreArmor = false)

Parameters

type AmmoType

The AmmoType of the ammo to check.

ignoreArmor bool

If the method should ignore the armor the player is wearing.

Returns

ushort

The maximum amount of ammo this player can carry.

GetCategoryLimit(ItemCategory, bool)

Gets the maximum amount of an ItemCategory the player can hold, based on the armor the player is wearing, as well as server configuration.

public sbyte GetCategoryLimit(ItemCategory category, bool ignoreArmor = false)

Parameters

category ItemCategory

The ItemCategory to check.

ignoreArmor bool

If the method should ignore the armor the player is wearing.

Returns

sbyte

The maximum amount of items in the category that the player can hold.

GetComponent(Type)

Gets a component from the IEntity.

public EActor GetComponent(Type type)

Parameters

type Type

The Type of the EActor to look for.

Returns

EActor

The EActor component.

GetComponent<T>()

Gets a component from the IEntity.

public T GetComponent<T>() where T : EActor

Returns

T

The EActor component.

Type Parameters

T

The T EActor to look for.

GetComponent<T>(Type)

Gets a component from the IEntity.

public T GetComponent<T>(Type type) where T : EActor

Parameters

type Type

The Type of the EActor to look for.

Returns

T

The EActor component.

Type Parameters

T

The cast T EActor.

GetCooldownItem(ItemType)

Get the time cooldown on this ItemType.

public float GetCooldownItem(ItemType itemType)

Parameters

itemType ItemType

The itemtypes to choose for getting cooldown.

Returns

float

Return the time in seconds of the cooldowns.

GetDanger(DangerType)

Gets an instance of CustomPlayerEffects.Danger.DangerStackBase by DangerType if the Scp1853 effect is enabled or null if it is not enabled.

public DangerStackBase GetDanger(DangerType dangerType)

Parameters

dangerType DangerType

The DangerType.

Returns

DangerStackBase

The CustomPlayerEffects.Danger.DangerStackBase.

GetEffect(EffectType)

Gets an instance of CustomPlayerEffects.StatusEffectBase by EffectType.

public StatusEffectBase GetEffect(EffectType effectType)

Parameters

effectType EffectType

The EffectType.

Returns

StatusEffectBase

The CustomPlayerEffects.StatusEffectBase.

GetEffectIntensity<T>()

Gets a byte indicating the intensity of the given CustomPlayerEffects.StatusEffectBase.

public byte GetEffectIntensity<T>() where T : StatusEffectBase

Returns

byte

The intensity of the effect.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to check.

Exceptions

ArgumentException

Thrown if the given type is not a valid CustomPlayerEffects.StatusEffectBase.

GetEffect<T>()

Gets an effect of a player.

public T GetEffect<T>() where T : StatusEffectBase

Returns

T

The CustomPlayerEffects.StatusEffectBase found.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to get.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetModule<T>()

Gets a PlayerStatsSystem.StatBase module from the player's PlayerStatsSystem.PlayerStats component.

public T GetModule<T>() where T : StatBase

Returns

T

The T module that was requested.

Type Parameters

T

The returned object type.

GetNearCameras(float)

Gets all the near cameras.

public IEnumerable<Camera> GetNearCameras(float toleration = 15)

Parameters

toleration float

The maximum toleration to define the radius from which get the cameras.

Returns

IEnumerable<Camera>

A IEnumerable<T> of Camera which contains all the found cameras.

GetProcessedData(ArraySegment<string>, int)

Gets an IEnumerable<T> containing all players processed based on the arguments specified.

public static IEnumerable<Player> GetProcessedData(ArraySegment<string> args, int startIndex = 0)

Parameters

args ArraySegment<string>

The array segment of strings representing the input arguments to be processed.

startIndex int

The starting index within the array segment.

Returns

IEnumerable<Player>

An IEnumerable<T> representing the processed players.

GetProcessedData(ArraySegment<string>, int, out string[], bool)

Gets an IEnumerable<T> containing all players processed based on the arguments specified.

public static IEnumerable<Player> GetProcessedData(ArraySegment<string> args, int startIndex, out string[] newargs, bool keepEmptyEntries = false)

Parameters

args ArraySegment<string>

The array segment of strings representing the input arguments to be processed.

startIndex int

The starting index within the array segment.

newargs string[]

Contains the updated arguments after processing.

keepEmptyEntries bool

Determines whether empty entries should be kept in the result.

Returns

IEnumerable<Player>

An IEnumerable<T> representing the processed players.

GetScpPreference(RoleTypeId)

Gets a user's SCP preference.

public int GetScpPreference(RoleTypeId roleType)

Parameters

roleType RoleTypeId

The SCP RoleType.

Returns

int

A value from -5 to 5, representing a player's preference to play as the provided SCP. Will return 0 for invalid SCPs.

GiveReservedSlot(bool)

Adds a player's UserId to the list of reserved slots.

public bool GiveReservedSlot(bool isPermanent)

Parameters

isPermanent bool

Whether to add a player's UserId permanently. It will write a player's UserId to UserIDReservedSlots.txt file.

Returns

bool

true if the slot was successfully added, or false if the provided UserId already has a reserved slot.

See Also

GrantLoadout()

Grants the player their current role's loadout.

public void GrantLoadout()

GrantLoadout(RoleTypeId)

Grants a player a role's loadout.

public void GrantLoadout(RoleTypeId roleType)

Parameters

roleType RoleTypeId

The role loadout to give.

GrantWhitelist(bool)

Adds a player's UserId to the whitelist.

public bool GrantWhitelist(bool isPermanent)

Parameters

isPermanent bool

Whether to add a player's UserId permanently. It will write a player's UserId to UserIDWhitelist.txt file.

Returns

bool

true if the record was successfully added, or false if the provided UserId already is in whitelist.

See Also

Handcuff()

Handcuff the player as administrator.

public void Handcuff()

Handcuff(Player)

Handcuff the player.

public void Handcuff(Player cuffer)

Parameters

cuffer Player

The cuffer player.

HasComponent(Type, bool)

Checks if the IEntity has an active component.

public bool HasComponent(Type type, bool depthInheritance = false)

Parameters

type Type

The EActor to look for.

depthInheritance bool

A value indicating whether subclasses should be considered.

Returns

bool

true if the component was found; otherwise, false.

HasComponent<T>(bool)

Checks if the IEntity has an active component.

public bool HasComponent<T>(bool depthInheritance = false)

Parameters

depthInheritance bool

A value indicating whether subclasses should be considered.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The EActor to look for.

HasCustomAmmoLimit(AmmoType)

Check if the player has a custom limit for a specific AmmoType.

public bool HasCustomAmmoLimit(AmmoType ammoType)

Parameters

ammoType AmmoType

The AmmoType to check.

Returns

bool

If the player has a custom limit for the specific AmmoType.

HasCustomCategoryLimit(ItemCategory)

Check if the player has a custom limit for a specific ItemCategory.

public bool HasCustomCategoryLimit(ItemCategory category)

Parameters

category ItemCategory

The ItemCategory to check.

Returns

bool

If the player has a custom limit for the specific ItemCategory.

HasItem(Item)

Indicates whether the player has an item.

public bool HasItem(Item item)

Parameters

item Item

The item to search for.

Returns

bool

true, if the player has it; otherwise, false.

HasItem(ItemType)

Indicates whether the player has an item type.

public bool HasItem(ItemType type)

Parameters

type ItemType

The type to search for.

Returns

bool

true, if the player has it; otherwise, false.

Heal(float, bool)

Heals the player.

public void Heal(float amount, bool overrideMaxHealth = false)

Parameters

amount float

The amount of health to heal.

overrideMaxHealth bool

Whether healing should exceed their max health.

Hurt(Player, float, DamageType, CassieAnnouncement)

Hurts the player.

public void Hurt(Player attacker, float amount, DamageType damageType = DamageType.Unknown, DamageHandlerBase.CassieAnnouncement cassieAnnouncement = null)

Parameters

attacker Player

The Player attacking player.

amount float

The float amount of damage to deal.

damageType DamageType

The DamageType of the damage dealt.

cassieAnnouncement DamageHandlerBase.CassieAnnouncement

The DamageHandlerBase.CassieAnnouncement cassie announcement to make if the damage kills the player.

Hurt(Player, float, DamageType, CassieAnnouncement, string)

Hurts the player.

public void Hurt(Player attacker, float amount, DamageType damageType = DamageType.Unknown, DamageHandlerBase.CassieAnnouncement cassieAnnouncement = null, string deathText = null)

Parameters

attacker Player

The Player attacking player.

amount float

The float amount of damage to deal.

damageType DamageType

The DamageType of the damage dealt.

cassieAnnouncement DamageHandlerBase.CassieAnnouncement

The DamageHandlerBase.CassieAnnouncement cassie announcement to make if the damage kills the player.

deathText string

The string death text to appear on Player screen.

Hurt(Player, float, Vector3, int)

Hurts the player.

public void Hurt(Player attacker, float damage, Vector3 force = default, int armorPenetration = 0)

Parameters

attacker Player

The Player attacking player.

damage float

The float amount of damage to deal.

force Vector3

The throw force.

armorPenetration int

The armor penetration amount.

Hurt(DamageHandlerBase)

Hurts the player.

public void Hurt(DamageHandlerBase damageHandlerBase)

Parameters

damageHandlerBase DamageHandlerBase

The PlayerStatsSystem.DamageHandlerBase used to deal damage.

Hurt(float, DamageType, string)

Hurts the player.

public void Hurt(float amount, DamageType damageType = DamageType.Unknown, string cassieAnnouncement = "")

Parameters

amount float

The float amount of damage to deal.

damageType DamageType

The DamageType of the damage dealt.

cassieAnnouncement string

The string cassie announcement to make if the damage kills the player.

Hurt(float, string, string)

Hurts the player.

public void Hurt(float damage, string damageReason, string cassieAnnouncement = "")

Parameters

damage float

The amount of damage to deal.

damageReason string

The reason for the damage being dealt.

cassieAnnouncement string

The cassie announcement to make.

IsEffectActive<T>()

Gets a bool describing whether the given status effect is currently enabled.

public bool IsEffectActive<T>() where T : StatusEffectBase

Returns

bool

A bool determining whether the player effect is active.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to check.

Kick(string, Player)

Kicks the player.

public void Kick(string reason, Player issuer = null)

Parameters

reason string

The kick reason.

issuer Player

The kick issuer.

Kill(DamageType, string)

Kills the player.

public void Kill(DamageType damageType, string cassieAnnouncement = "")

Parameters

damageType DamageType

The DamageType the player has been killed.

cassieAnnouncement string

The cassie announcement to make upon death.

Kill(DamageHandlerBase)

Kills the player.

public void Kill(DamageHandlerBase damageHandlerBase)

Parameters

damageHandlerBase DamageHandlerBase

The PlayerStatsSystem.DamageHandlerBase.

Kill(string, string)

Kills the player.

public void Kill(string deathReason, string cassieAnnouncement = "")

Parameters

deathReason string

The reason the player has been killed.

cassieAnnouncement string

The cassie announcement to make upon death.

Mute(bool)

Persistently mutes the player. For temporary mutes, see IsMuted and IsIntercomMuted.

public void Mute(bool isIntercom = false)

Parameters

isIntercom bool

Whether this mute is for the intercom only.

OpenReportWindow(string)

Opens the report window.

public void OpenReportWindow(string text)

Parameters

text string

The text to send.

PlaceBlood(Vector3)

Places a blood decal.

public void PlaceBlood(Vector3 direction)

Parameters

direction Vector3

The direction of the blood decal.

PlaceTantrum(bool)

Places a Tantrum (SCP-173's ability) under the player.

public TantrumHazard PlaceTantrum(bool isActive = true)

Parameters

isActive bool

Whether the tantrum will apply the Stained effect.

Returns

TantrumHazard

The TantrumHazard instance..

Remarks

If isActive is true, the tantrum is moved slightly up from its original position. Otherwise, the collision will not be detected and the slowness will not work.

PlayGunSound(ItemType, byte, byte)

Plays a gun sound that only the player can hear.

public void PlayGunSound(ItemType type, byte volume, byte audioClipId = 0)

Parameters

type ItemType
volume byte

Sound's volume to set.

audioClipId byte

GunAudioMessage's audioClipId to set (default = 0).

PlayShieldBreakSound()

Plays the Hume Shield break sound effect from the player.

public void PlayShieldBreakSound()

Remarks

This will only function if the player's IsHumeShieldedRole is true.

RandomTeleport(IEnumerable<Type>)

Teleports the player to a random object.

public void RandomTeleport(IEnumerable<Type> types)

Parameters

types IEnumerable<Type>

The list of object types to choose from.

RandomTeleport(Type)

Teleports player to a random object of a specific type.

public void RandomTeleport(Type type)

Parameters

type Type

Object for teleport.

RandomTeleport<T>()

Teleports player to a random object of a specific type.

public void RandomTeleport<T>()

Type Parameters

T

Object for teleport.

Reconnect(ushort, float, bool, RoundRestartType)

Reconnects the player to the server. Can be used to redirect them to another server on a different port but same IP.

public void Reconnect(ushort newPort = 0, float delay = 5, bool reconnect = true, RoundRestartType roundRestartType = RoundRestartType.FullRestart)

Parameters

newPort ushort

New port.

delay float

Player reconnection delay.

reconnect bool

Whether player should be reconnected.

roundRestartType RoundRestartType

Type of round restart.

ReloadReservedSlots()

Reloads the reserved slot list, clearing all reserved slot changes made with add/remove methods and reverting to the reserved slots files.

public static void ReloadReservedSlots()

ReloadWeapon()

Forces the player to reload their current weapon.

public bool ReloadWeapon()

Returns

bool

true if firearm was successfully reloaded. Otherwise, false.

ReloadWhitelist()

Reloads the whitelist, clearing all whitelist changes made with add/remove methods and reverting to the whitelist files.

public static void ReloadWhitelist()

RemoteAdminMessage(string, bool, string)

Sends a message to the player's Remote Admin console.

public void RemoteAdminMessage(string message, bool success = true, string pluginName = null)

Parameters

message string

The message to be sent.

success bool

Indicates whether the message should be highlighted as success.

pluginName string

The plugin name.

RemoveHandcuffs()

Removes the player's handcuffs.

public void RemoveHandcuffs()

RemoveHeldItem(bool)

Removes the held InventorySystem.Items.ItemBase from the player's inventory.

public bool RemoveHeldItem(bool destroy = true)

Parameters

destroy bool

Whether to destroy the item.

Returns

bool

Returns a value indicating whether the InventorySystem.Items.ItemBase was removed.

RemoveItem(Item, bool)

Removes an Item from the player's inventory.

public bool RemoveItem(Item item, bool destroy = true)

Parameters

item Item

The Item to remove.

destroy bool

Whether to destroy the item.

Returns

bool

A value indicating whether the Item was removed.

RemoveItem(Func<Item, bool>, bool)

Removes all Item's that satisfy the condition from the player's inventory.

public int RemoveItem(Func<Item, bool> predicate, bool destroy = true)

Parameters

predicate Func<Item, bool>

The condition to satisfy.

destroy bool

Whether to destroy the items.

Returns

int

Count of a successfully removed Item's.

RemoveItem(ushort, bool)

Removes an Item from the player's inventory.

public bool RemoveItem(ushort serial, bool destroy = true)

Parameters

serial ushort

The Item serial to remove.

destroy bool

Whether to destroy the item.

Returns

bool

A value indicating whether the Item was removed.

ResetAmmoLimit(AmmoType)

Reset a custom AmmoType limit.

public void ResetAmmoLimit(AmmoType ammoType)

Parameters

ammoType AmmoType

The AmmoType of the ammo to reset.

ResetCategoryLimit(ItemCategory)

Reset a custom ItemCategory limit. Only works with ItemCategory.Keycard, ItemCategory.Medical, ItemCategory.Firearm, ItemCategory.Grenade and ItemCategory.SCPItem.

public void ResetCategoryLimit(ItemCategory category)

Parameters

category ItemCategory

The ItemCategory of the category to reset.

ResetInventory(IEnumerable<Item>)

Resets the player's inventory to the provided list of items, clearing any items it already possess.

public void ResetInventory(IEnumerable<Item> newItems)

Parameters

newItems IEnumerable<Item>

The new items that have to be added to the inventory.

ResetInventory(IEnumerable<ItemType>)

Resets the player's inventory to the provided list of items, clearing any items it already possess.

public void ResetInventory(IEnumerable<ItemType> newItems)

Parameters

newItems IEnumerable<ItemType>

The new items that have to be added to the inventory.

ResetStamina()

Resets the Player's stamina.

public void ResetStamina()

SendConsoleMessage(string, string)

Sends a console message to the player's console.

public void SendConsoleMessage(string message, string color)

Parameters

message string

The message to be sent.

color string

The message color.

SendStaffMessage(string, EncryptedChannel)

Sends a message to the player's Remote Admin Chat.

public bool SendStaffMessage(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannel.AdminChat)

Parameters

message string

The message to be sent.

channel EncryptedChannelManager.EncryptedChannel

Indicates whether the message should be highlighted as success.

Returns

bool

true if message was send; otherwise, false.

SendStaffPing(string, EncryptedChannel)

Sends a message to the player's Remote Admin Chat.

public bool SendStaffPing(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannel.AdminChat)

Parameters

message string

The message to be sent.

channel EncryptedChannelManager.EncryptedChannel

Indicates whether the message should be highlighted as success.

Returns

bool

true if message was send; otherwise, false.

SetAmmo(AmmoType, ushort)

Sets the amount of a specified ammo type to the player's inventory.

public void SetAmmo(AmmoType ammoType, ushort amount)

Parameters

ammoType AmmoType

The AmmoType to be set.

amount ushort

The amount of ammo to be set.

SetAmmo(Dictionary<AmmoType, ushort>)

Sets the amount of a specified ammo type to player's inventory.

public void SetAmmo(Dictionary<AmmoType, ushort> ammoBag)

Parameters

ammoBag Dictionary<AmmoType, ushort>

A dictionary of ammo types that will be added.

SetAmmoLimit(AmmoType, ushort)

Gets the maximum amount of ammo the player can hold, given the ammo AmmoType. This limit will scale with the armor the player is wearing. For armor ammo limits, see AmmoLimits.

public void SetAmmoLimit(AmmoType ammoType, ushort limit)

Parameters

ammoType AmmoType

The AmmoType of the ammo to check.

limit ushort

The ushort number that will define the new limit.

SetCategoryLimit(ItemCategory, sbyte)

Set the maximum amount of an ItemCategory the player can hold. Only works with ItemCategory.Keycard, ItemCategory.Medical, ItemCategory.Firearm, ItemCategory.Grenade and ItemCategory.SCPItem. This limit will scale with the armor the player is wearing. For armor category limits, see CategoryLimits.

public void SetCategoryLimit(ItemCategory category, sbyte limit)

Parameters

category ItemCategory

The ItemCategory to check.

limit sbyte

The int number that will define the new limit.

SetCooldownItem(float, ItemType)

Set the time cooldown on this ItemType.

public void SetCooldownItem(float time, ItemType itemType)

Parameters

time float

The times for the cooldown.

itemType ItemType

The itemtypes to choose for being cooldown.

SetCustomRoleFriendlyFire(string, RoleTypeId, float)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public void SetCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, float ffMult)

Parameters

roleTypeId string

Role associated for CustomFF.

roleToAdd RoleTypeId

Role to add.

ffMult float

Friendly fire multiplier.

SetCustomRoleFriendlyFire(string, KeyValuePair<RoleTypeId, float>)

public void SetCustomRoleFriendlyFire(string roleTypeId, KeyValuePair<RoleTypeId, float> roleFf)

Parameters

roleTypeId string

Role associated for CustomFF.

roleFf KeyValuePair<RoleTypeId, float>

Role with FF to add even if it exists.

SetFakeScale(Vector3, IEnumerable<Player>)

Sets the scale of the player for other players.

public void SetFakeScale(Vector3 fakeScale, IEnumerable<Player> viewers)

Parameters

fakeScale Vector3

The scale to set to.

viewers IEnumerable<Player>

Who should see the fake scale.

SetFriendlyFire(RoleTypeId, float)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public void SetFriendlyFire(RoleTypeId roleToAdd, float ffMult)

Parameters

roleToAdd RoleTypeId

Role to add.

ffMult float

Friendly fire multiplier.

SetFriendlyFire(KeyValuePair<RoleTypeId, float>)

public void SetFriendlyFire(KeyValuePair<RoleTypeId, float> roleFF)

Parameters

roleFF KeyValuePair<RoleTypeId, float>

Role with FF to add even if it exists.

SetRank(string, UserGroup)

Sets the player's rank.

public void SetRank(string name, UserGroup group)

Parameters

name string

The rank name to be set.

group UserGroup

The group to be set.

SetScale(Vector3, IEnumerable<Player>)

Sets the scale of a player on the server side.

public void SetScale(Vector3 scale, IEnumerable<Player> viewers)

Parameters

scale Vector3

The scale to set.

viewers IEnumerable<Player>

Who should see the updated scale.

ShowHint(Hint)

Show a hint to the player.

public void ShowHint(Hint hint)

Parameters

hint Hint

The hint to be shown.

ShowHint(string, float)

Shows a hint to the player.

public void ShowHint(string message, float duration = 3)

Parameters

message string

The message to be shown.

duration float

The duration the text will be on screen.

ShowHitMarker(float)

Sends a HitMarker to the player.

public void ShowHitMarker(float size = 1)

Parameters

size float

The size of the hitmarker, ranging from 0 to Hitmarker.MaxSize).

SyncEffect(Effect)

Syncs the status effect on the player.

public void SyncEffect(Effect effect)

Parameters

effect Effect

The Effect to sync.

SyncEffects(IEnumerable<Effect>)

Syncs a IEnumerable<T> of Effect on the player.

public void SyncEffects(IEnumerable<Effect> effects)

Parameters

effects IEnumerable<Effect>

The IEnumerable<T> of Effect to enable.

Teleport(object)

Teleports the player to the given object, with no offset.

public void Teleport(object obj)

Parameters

obj object

The object to teleport to.

Teleport(object, Vector3)

Teleports the player to the given object, offset by the defined offset value.

public void Teleport(object obj, Vector3 offset)

Parameters

obj object

The object to teleport the player to.

offset Vector3

The offset to teleport.

Teleport(Vector3)

Teleports the player to the given UnityEngine.Vector3 coordinates.

public void Teleport(Vector3 position)

Parameters

position Vector3

The UnityEngine.Vector3 coordinates to move the player to.

ThrowGrenade(ProjectileType, bool)

Forces the player to throw a grenade.

public Throwable ThrowGrenade(ProjectileType type, bool fullForce = true)

Parameters

type ProjectileType

The ProjectileType to be thrown.

fullForce bool

Whether to throw with full or half force.

Returns

Throwable

The Throwable item that was spawned.

ThrowItem(Throwable, bool)

Forcefully throws a throwable item.

public void ThrowItem(Throwable throwable, bool fullForce = true)

Parameters

throwable Throwable

The Throwable to be thrown.

fullForce bool

Whether to throw with full or half force.

ToString()

Converts the player in a human-readable format.

public override string ToString()

Returns

string

A string containing Player-related data.

TryAddCandy(CandyKindID)

Gives the player a specific candy. Will give the player a bag if they do not already have one.

public bool TryAddCandy(CandyKindID candyType)

Parameters

candyType CandyKindID

The InventorySystem.Items.Usables.Scp330.CandyKindID to give.

Returns

bool

true if a candy was given.

TryAddCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>>)

Adds the Custom role to the CustomRoleFriendlyFireMultiplier if they did not already exist.

public void TryAddCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>> customRoleFriendlyFireMultiplier)

Parameters

customRoleFriendlyFireMultiplier Dictionary<string, Dictionary<RoleTypeId, float>>

Custom role with FF role rules.

TryAddCustomRoleFriendlyFire(string, RoleTypeId, float)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules for CustomRole.

public bool TryAddCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, float ffMult)

Parameters

roleTypeId string

Role associated for CustomFF.

roleToAdd RoleTypeId

Role to add.

ffMult float

Friendly fire multiplier.

Returns

bool

Whether the item was able to be added.

TryAddCustomRoleFriendlyFire(string, Dictionary<RoleTypeId, float>, bool)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public bool TryAddCustomRoleFriendlyFire(string customRoleName, Dictionary<RoleTypeId, float> ffRules, bool overwrite = false)

Parameters

customRoleName string

Role associated for CustomFF.

ffRules Dictionary<RoleTypeId, float>

Roles to add with friendly fire values.

overwrite bool

Whether to overwrite current values if they exist - does NOT delete previous entries if they are not in provided rules.

Returns

bool

Whether the item was able to be added.

TryAddCustomRoleFriendlyFire(string, KeyValuePair<RoleTypeId, float>)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules for CustomRole.

public bool TryAddCustomRoleFriendlyFire(string roleTypeId, KeyValuePair<RoleTypeId, float> roleFf)

Parameters

roleTypeId string

Role associated for CustomFF.

roleFf KeyValuePair<RoleTypeId, float>

Role to add and FF multiplier.

Returns

bool

Whether the item was able to be added.

TryAddFriendlyFire(RoleTypeId, float)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public bool TryAddFriendlyFire(RoleTypeId roleToAdd, float ffMult)

Parameters

roleToAdd RoleTypeId

Role to add.

ffMult float

Friendly fire multiplier.

Returns

bool

Whether the item was able to be added.

TryAddFriendlyFire(Dictionary<RoleTypeId, float>, bool)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public bool TryAddFriendlyFire(Dictionary<RoleTypeId, float> ffRules, bool overwrite = false)

Parameters

ffRules Dictionary<RoleTypeId, float>

Roles to add with friendly fire values.

overwrite bool

Whether to overwrite current values if they exist.

Returns

bool

Whether the item was able to be added.

TryAddFriendlyFire(KeyValuePair<RoleTypeId, float>)

Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.

public bool TryAddFriendlyFire(KeyValuePair<RoleTypeId, float> pairedRoleFF)

Parameters

pairedRoleFF KeyValuePair<RoleTypeId, float>

Role FF multiplier to add.

Returns

bool

Whether the item was able to be added.

TryGet(CommandSender, out Player)

Try-get a player given a CommandSender.

public static bool TryGet(CommandSender sender, out Player player)

Parameters

sender CommandSender

The CommandSender.

player Player

The player that matches the given CommandSender, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(ICommandSender, out Player)

Try-get a player given a CommandSystem.ICommandSender.

public static bool TryGet(ICommandSender sender, out Player player)

Parameters

sender ICommandSender

The CommandSystem.ICommandSender.

player Player

The player that matches the given CommandSystem.ICommandSender, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(Footprint, out Player)

Try-get a player given a Footprinting.Footprint.

public static bool TryGet(Footprint footprint, out Player player)

Parameters

footprint Footprint

The Footprinting.Footprint.

player Player

The player that matches the given Footprinting.Footprint, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(NetworkConnection, out Player)

Try-get a player given a Mirror.NetworkConnection.

public static bool TryGet(NetworkConnection conn, out Player player)

Parameters

conn NetworkConnection

The Mirror.NetworkConnection.

player Player

The player that matches the given Mirror.NetworkConnection, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(NetworkIdentity, out Player)

Try-get a player given a Mirror.NetworkIdentity.

public static bool TryGet(NetworkIdentity netIdentity, out Player player)

Parameters

netIdentity NetworkIdentity

The Mirror.NetworkIdentity.

player Player

The player that matches the given Mirror.NetworkIdentity, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(Player, out Player)

Try-get the Player from NwPluginAPI class.

public static bool TryGet(Player apiPlayer, out Player player)

Parameters

apiPlayer Player

The PluginAPI.Core.Player class.

player Player

The player found or null if not found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(ReferenceHub, out Player)

Try-get a player given a ReferenceHub.

public static bool TryGet(ReferenceHub referenceHub, out Player player)

Parameters

referenceHub ReferenceHub

The ReferenceHub.

player Player

The player that matches the given ReferenceHub, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(int, out Player)

Try-get a player given an ID.

public static bool TryGet(int id, out Player player)

Parameters

id int

The user ID.

player Player

The player that matches the given ID, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(string, out Player)

Try-get a player by identifier.

public static bool TryGet(string args, out Player player)

Parameters

args string

The player's nickname, ID, steamID64 or Discord ID.

player Player

The player found or null if not found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(uint, out Player)

Try-get a player given a network ID.

public static bool TryGet(uint netId, out Player player)

Parameters

netId uint

The network ID.

player Player

The player that matches the given net ID, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(Collider, out Player)

Try-get player by UnityEngine.Collider.

public static bool TryGet(Collider collider, out Player player)

Parameters

collider Collider

The UnityEngine.Collider.

player Player

The player found or null if not found.

Returns

bool

A boolean indicating whether a player was found.

TryGet(GameObject, out Player)

Try-get a player given a UnityEngine.GameObject.

public static bool TryGet(GameObject gameObject, out Player player)

Parameters

gameObject GameObject

The UnityEngine.GameObject.

player Player

The player that matches the given UnityEngine.GameObject, or null if no player is found.

Returns

bool

A boolean indicating whether a player was found.

TryGetComponent(Type, out EActor)

Tries to get a component from the IEntity.

public bool TryGetComponent(Type type, out EActor component)

Parameters

type Type

The Type of the EActor to get.

component EActor

The found component.

Returns

bool

true if the component was found; otherwise, false.

TryGetComponent<T>(Type, out T)

Tries to get a component from the IEntity.

public bool TryGetComponent<T>(Type type, out T component) where T : EActor

Parameters

type Type

The Type of the EActor to get.

component T

The found component.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The cast T EActor.

TryGetComponent<T>(out T)

Tries to get a component from the IEntity.

public bool TryGetComponent<T>(out T component) where T : EActor

Parameters

component T

The T EActor.

Returns

bool

true if the component was found; otherwise, false.

Type Parameters

T

The T EActor to look for.

TryGetDanger(DangerType, out DangerStackBase)

Tries to get an instance of CustomPlayerEffects.StatusEffectBase by EffectType (does not work if the Scp1853 effect is not enabled).

public bool TryGetDanger(DangerType type, out DangerStackBase danger)

Parameters

type DangerType

The EffectType.

danger DangerStackBase

The CustomPlayerEffects.StatusEffectBase.

Returns

bool

A bool indicating whether the danger was successfully gotten.

TryGetEffect(EffectType, out StatusEffectBase)

Tries to get an instance of CustomPlayerEffects.StatusEffectBase by EffectType.

public bool TryGetEffect(EffectType type, out StatusEffectBase statusEffect)

Parameters

type EffectType

The EffectType.

statusEffect StatusEffectBase

The CustomPlayerEffects.StatusEffectBase.

Returns

bool

A bool indicating whether the statusEffect was successfully gotten.

TryGetEffect<T>(out T)

Tries to get an instance of CustomPlayerEffects.StatusEffectBase by EffectType.

public bool TryGetEffect<T>(out T statusEffect) where T : StatusEffectBase

Parameters

statusEffect T

The CustomPlayerEffects.StatusEffectBase.

Returns

bool

A bool indicating whether the statusEffect was successfully gotten.

Type Parameters

T

The CustomPlayerEffects.StatusEffectBase to get.

TryGetItem(ushort, out Item)

Tries to get an item from a player's inventory.

public bool TryGetItem(ushort serial, out Item item)

Parameters

serial ushort

The unique identifier of the item.

item Item

The Item found. null if it doesn't exist.

Returns

bool

true if the item is found, false otherwise.

TryGetSessionVariable<T>(string, out T)

Safely gets an object from SessionVariables, then casts it to T.

public bool TryGetSessionVariable<T>(string key, out T result)

Parameters

key string

The key of the object to get.

result T

When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter is used.

Returns

bool

true if the SessionVariables contains an element with the specified key; otherwise, false.

Type Parameters

T

The returned object type.

TryRemoveCustomeRoleFriendlyFire(string)

Tries to remove PlayerRoles.RoleTypeId from FriendlyFire rules.

public bool TryRemoveCustomeRoleFriendlyFire(string role)

Parameters

role string

Role to add.

Returns

bool

Whether the item was able to be added.

TryRemoveFriendlyFire(RoleTypeId)

Tries to remove PlayerRoles.RoleTypeId from FriendlyFire rules.

public bool TryRemoveFriendlyFire(RoleTypeId role)

Parameters

role RoleTypeId

Role to add.

Returns

bool

Whether the item was able to be added.

TrySetCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>>)

public void TrySetCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>> customRoleFriendlyFireMultiplier)

Parameters

customRoleFriendlyFireMultiplier Dictionary<string, Dictionary<RoleTypeId, float>>

New rules for CustomeRoleFriendlyFireMultiplier to set to.

TrySetCustomRoleFriendlyFire(string, Dictionary<RoleTypeId, float>)

public void TrySetCustomRoleFriendlyFire(string roleTypeId, Dictionary<RoleTypeId, float> customRoleFriendlyFireMultiplier)

Parameters

roleTypeId string

Role to associate FF rules to.

customRoleFriendlyFireMultiplier Dictionary<RoleTypeId, float>

New rules for CustomeRoleFriendlyFireMultiplier to set to.

UnMute(bool)

Revokes a persistent mute. For temporary mutes, see IsMuted and IsIntercomMuted.

public void UnMute(bool isIntercom = false)

Parameters

isIntercom bool

Whether this un-mute is for the intercom only.

UseItem(Item)

Forces the player to use an item.

public bool UseItem(Item item)

Parameters

item Item

The item to be used.

Returns

bool

true if item was used successfully. Otherwise, false.

UseItem(Usable)

Forces the player to use an item.

public void UseItem(Usable usable)

Parameters

usable Usable

The item to be used.

UseItem(ItemType)

Forces the player to use an item.

public bool UseItem(ItemType usableItem)

Parameters

usableItem ItemType

The ItemType to be used.

Returns

bool

true if item was used successfully. Otherwise, false.

Vaporize(Player, string)

Kills the player and vaporizes the body.

public void Vaporize(Player attacker = null, string cassieAnnouncement = "")

Parameters

attacker Player

The Player attacking player.

cassieAnnouncement string

The cassie announcement to make upon death.

Operators

operator ==(Player, Player)

Returns whether the two players are the same.

public static bool operator ==(Player player1, Player player2)

Parameters

player1 Player

The first player instance.

player2 Player

The second player instance.

Returns

bool

true if the values are equal.

implicit operator Player(Player)

Converts NwPluginAPI player to EXILED player.

public static implicit operator Player(Player player)

Parameters

player Player

The NwPluginAPI player.

Returns

Player

EXILED player.

operator !=(Player, Player)

Returns whether the two players are different.

public static bool operator !=(Player player1, Player player2)

Parameters

player1 Player

The first player instance.

player2 Player

The second player instance.

Returns

bool

true if the values are not equal.