Class Player
Represents the in-game player, by encapsulating a ReferenceHub.
Inherited Members
Namespace: Exiled.API.Features
Assembly: Exiled.API.dll
Syntax
public class Player : TypeCastObject<Player>, IEntity, IWorldSpace, IPosition, IRotation
Constructors
| Improve this Doc View SourcePlayer(ReferenceHub)
Initializes a new instance of the Player class.
Declaration
public Player(ReferenceHub referenceHub)
Parameters
| Type | Name | Description |
|---|---|---|
| ReferenceHub | referenceHub | The ReferenceHub of the player to be encapsulated. |
Player(GameObject)
Initializes a new instance of the Player class.
Declaration
public Player(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.GameObject | gameObject | The UnityEngine.GameObject of the player. |
Properties
| Improve this Doc View SourceActiveArtificialHealthProcesses
Gets a System.Collections.Generic.IEnumerable<T> of all active Artificial Health processes on the player.
Declaration
public IEnumerable<AhpStat.AhpProcess> ActiveArtificialHealthProcesses { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<PlayerStatsSystem.AhpStat.AhpProcess> |
ActiveEffects
Gets all currently active CustomPlayerEffects.StatusEffectBase.
Declaration
public IEnumerable<StatusEffectBase> ActiveEffects { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<CustomPlayerEffects.StatusEffectBase> |
See Also
AdminChatAccess
Gets a value indicating whether or not the player has Admin Chat access.
Declaration
public bool AdminChatAccess { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
AgreedToRecording
Gets a value indicating whether or not the player has agreed to microphone recording.
Declaration
public bool AgreedToRecording { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Ammo
Gets the player's ammo.
Declaration
public Dictionary<ItemType, ushort> Ammo { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<ItemType, System.UInt16> |
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.
Declaration
public float ArtificialHealth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
AuthenticationToken
Gets the player's authentication token.
Declaration
public string AuthenticationToken { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
AuthenticationType
Gets the player's authentication type.
Declaration
public AuthenticationType AuthenticationType { get; }
Property Value
| Type | Description |
|---|---|
| AuthenticationType |
BadgeHidden
Gets or sets a value indicating whether or not the player's badge is hidden.
Declaration
public bool BadgeHidden { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CameraTransform
Gets the encapsulated ReferenceHub's PlayerCameraReference.
Declaration
public Transform CameraTransform { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Transform |
ComponentsInChildren
Declaration
public IReadOnlyCollection<EActor> ComponentsInChildren { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<EActor> |
Connection
Gets player's Mirror.NetworkConnection.
Declaration
public NetworkConnection Connection { get; }
Property Value
| Type | Description |
|---|---|
| Mirror.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.
Declaration
public Player Cuffer { get; set; }
Property Value
| Type | Description |
|---|---|
| Player |
CurrentArmor
Gets the armor that the player is currently wearing. Value will be null if the player is not wearing any armor.
Declaration
public Armor CurrentArmor { get; }
Property Value
| Type | Description |
|---|---|
| Armor |
CurrentHint
Gets the hint currently watched by the player.
Declaration
public Hint CurrentHint { get; }
Property Value
| Type | Description |
|---|---|
| Hint |
CurrentItem
Gets or sets the item in the player's hand. Value will be null if the player is not holding anything.
Declaration
public Item CurrentItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Item |
See Also
| Improve this Doc View SourceCurrentRoom
Gets the current Room the player is in.
Declaration
public Room CurrentRoom { get; }
Property Value
| Type | Description |
|---|---|
| Room |
CurrentSpectatingPlayers
Gets a Player System.Collections.Generic.IEnumerable<T> of spectators that are currently spectating this Player.
Declaration
public IEnumerable<Player> CurrentSpectatingPlayers { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Player> |
CustomInfo
Gets or sets the player's custom player info string. This string is displayed along with the player's InfoArea.
Declaration
public string CustomInfo { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
CustomName
Gets or sets the player's nickname, if null it sets the original nickname.
Declaration
public string CustomName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
CustomRoleFriendlyFireMultiplier
Gets or sets a System.Collections.Generic.Dictionary<TKey, TValue> containing cached System.String and their System.Collections.Generic.Dictionary<TKey, TValue> which is cached Role with FF multiplier. This is for unique custom roles.
Declaration
public Dictionary<string, Dictionary<RoleTypeId, float>> CustomRoleFriendlyFireMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single>> |
Remarks
Consider adding this as object, Dict so that CustomRoles, and Strings can be parsed.
CustomUserId
Gets or sets the player's custom user id.
Declaration
[Obsolete("Remove by NW", true)]
public string CustomUserId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Dictionary
Gets a System.Collections.Generic.Dictionary<TKey, TValue> containing all Player's on the server.
Declaration
public static Dictionary<GameObject, Player> Dictionary { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<UnityEngine.GameObject, Player> |
DisplayNickname
Gets or sets the player's nickname displayed to other player.
Declaration
public string DisplayNickname { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DoNotTrack
Gets a value indicating whether or not 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.
Declaration
public bool DoNotTrack { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Footprint
Gets the player's Footprinting.Footprint.
Declaration
public Footprint Footprint { get; }
Property Value
| Type | Description |
|---|---|
| Footprinting.Footprint |
FriendlyFireMultiplier
Gets or sets a System.Collections.Generic.Dictionary<TKey, TValue> containing cached PlayerRoles.RoleTypeId and their FF multiplier. This is for non-unique roles.
Declaration
public Dictionary<RoleTypeId, float> FriendlyFireMultiplier { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single> |
GameObject
Gets the encapsulated UnityEngine.GameObject.
Declaration
public GameObject GameObject { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.GameObject |
GlobalBadge
Gets the global badge of the player. Value will be null if the player does not have a global badge.
Declaration
public Badge? GlobalBadge { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<Badge> |
Group
Gets or sets the player's group.
Declaration
public UserGroup Group { get; set; }
Property Value
| Type | Description |
|---|---|
| UserGroup |
GroupName
Gets or sets the player's group name.
Declaration
public string GroupName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
HasCustomName
Gets a value indicating whether or not the player has an active CustomName.
Declaration
public bool HasCustomName { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasFlashlightModuleEnabled
Gets a value indicating whether or not the player has enabled weapon's flashlight module.
Declaration
public bool HasFlashlightModuleEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasHint
Gets a value indicating whether or not the player is viewing a hint.
Declaration
public bool HasHint { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasReservedSlot
Gets a value indicating whether or not the player has a reserved slot.
Declaration
public bool HasReservedSlot { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
See Also
| Improve this Doc View SourceHealth
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.
Declaration
public float Health { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
HintDisplay
Gets the Hints.HintDisplay of the player.
Declaration
public HintDisplay HintDisplay { get; }
Property Value
| Type | Description |
|---|---|
| Hints.HintDisplay |
HumeShield
Gets or sets the player's Hume Shield.
Declaration
public float HumeShield { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
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.
HumeShieldStat
Gets the player's PlayerStatsSystem.HumeShieldStat.
Declaration
public HumeShieldStat HumeShieldStat { get; }
Property Value
| Type | Description |
|---|---|
| PlayerStatsSystem.HumeShieldStat |
Id
Gets or sets the player's id.
Declaration
public int Id { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
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.
Declaration
public PlayerInfoArea InfoArea { get; set; }
Property Value
| Type | Description |
|---|---|
| PlayerInfoArea |
InfoViewRange
Gets or sets the range at which this player's info can be viewed by others.
Declaration
public float InfoViewRange { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Inventory
Gets the player's InventorySystem.Inventory.
Declaration
public Inventory Inventory { get; }
Property Value
| Type | Description |
|---|---|
| InventorySystem.Inventory |
IPAddress
Gets the player's IP address.
Declaration
public string IPAddress { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
IsAimingDownWeapon
Gets a value indicating whether or not the player is aiming with a weapon.
Declaration
public bool IsAimingDownWeapon { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsAlive
Gets a value indicating whether or not the player is alive.
Declaration
public bool IsAlive { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsBypassModeEnabled
Gets or sets a value indicating whether or not the player's bypass mode is enabled.
Declaration
public bool IsBypassModeEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsCHI
Gets a value indicating whether or not the player's PlayerRoles.RoleTypeId is any Chaos rank. Equivalent to checking the player's PlayerRoles.Team.
Declaration
public bool IsCHI { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsConnected
Gets a value indicating whether the player is fully connected to the server.
Declaration
public bool IsConnected { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsCuffed
Gets a value indicating whether or not the player is cuffed.
Declaration
public bool IsCuffed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Players can be cuffed without another player being the cuffer.
IsDead
Gets a value indicating whether or not the player is dead.
Declaration
public bool IsDead { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsFriendlyFireEnabled
Gets a value indicating whether or not 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.
Declaration
public bool IsFriendlyFireEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsGlobalModerator
Gets a value indicating whether or not the player is a global moderator.
Declaration
public bool IsGlobalModerator { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsGlobalMuted
Gets or sets a value indicating whether or not the player is global muted.
Declaration
public bool IsGlobalMuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(Boolean) and UnMute(Boolean).
IsGodModeEnabled
Gets or sets a value indicating whether or not the player has godmode enabled.
Declaration
public bool IsGodModeEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsHost
Gets a value indicating whether or not the player is the host.
Declaration
public bool IsHost { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsHuman
Gets a value indicating whether or not the player's PlayerRoles.RoleTypeId is any human rank.
Declaration
public bool IsHuman { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsInPocketDimension
Gets a value indicating whether or not the player is in the pocket dimension.
Declaration
public bool IsInPocketDimension { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsIntercomMuted
Gets or sets a value indicating whether or not the player is intercom muted.
Declaration
public bool IsIntercomMuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(Boolean) and UnMute(Boolean).
IsInventoryEmpty
Gets a value indicating whether or not the player's inventory is empty.
Declaration
public bool IsInventoryEmpty { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsInventoryFull
Gets a value indicating whether or not the player's inventory is full.
Declaration
public bool IsInventoryFull { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsJumping
Gets a value indicating whether or not the player is jumping.
Declaration
public bool IsJumping { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsMuted
Gets or sets a value indicating whether or not the player is muted.
Declaration
public bool IsMuted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This property will NOT persistently mute and unmute the player. For persistent mutes, see Mute(Boolean) and UnMute(Boolean).
IsNoclipPermitted
Gets or sets a value indicating whether or not the player is allowed to enter noclip mode.
Declaration
public bool IsNoclipPermitted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
For forcing the player into noclip mode, see IsNoclipEnabled.
See Also
| Improve this Doc View SourceIsNorthwoodStaff
Gets a value indicating whether or not the player is Northwood staff.
Declaration
public bool IsNorthwoodStaff { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsNPC
Gets or sets a value indicating whether or not the player is a NPC.
Declaration
public bool IsNPC { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsNTF
Gets a value indicating whether or not the player's PlayerRoles.RoleTypeId is any NTF rank. Equivalent to checking the player's PlayerRoles.Team.
Declaration
public bool IsNTF { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsOverwatchEnabled
Gets or sets a value indicating whether or not the player's overwatch is enabled.
Declaration
public bool IsOverwatchEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsReloading
Gets a value indicating whether or not the player is reloading a weapon.
Declaration
public bool IsReloading { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsScp
Gets a value indicating whether or not the player's PlayerRoles.RoleTypeId is any SCP. Equivalent to checking the player's PlayerRoles.Team.
Declaration
public bool IsScp { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSpawnProtected
Gets or sets a value indicating whether or not the player is spawn protected.
Declaration
public bool IsSpawnProtected { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSpeaking
Gets a value indicating whether or not the player is speaking.
Declaration
public bool IsSpeaking { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsStaffBypassEnabled
Gets a value indicating whether or not the staff bypass is enabled.
Declaration
public bool IsStaffBypassEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsTransmitting
Gets a value indicating whether or not the player is transmitting on a Radio.
Declaration
public bool IsTransmitting { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsTutorial
Gets a value indicating whether or not the player's PlayerRoles.RoleTypeId is equal to PlayerRoles.RoleTypeId.Tutorial.
Declaration
public bool IsTutorial { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsUsingStamina
Gets or sets a value indicating whether or not the player should use stamina system.
Declaration
public bool IsUsingStamina { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsVerified
Gets a value indicating whether or not the player is verified.
Declaration
public bool IsVerified { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This is always false if online_mode is set to false.
IsWhitelisted
Gets a value indicating whether or not the player is in whitelist.
Declaration
public bool IsWhitelisted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
It will always return true if a whitelist is disabled on the server.
See Also
| Improve this Doc View SourceItems
Gets the player's items.
Declaration
public IReadOnlyCollection<Item> Items { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<Item> |
KickPower
Gets a value indicating a player's kick power.
Declaration
public byte KickPower { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
LeadingTeam
Gets the player's LeadingTeam.
Declaration
public LeadingTeam LeadingTeam { get; }
Property Value
| Type | Description |
|---|---|
| LeadingTeam |
Lift
Gets the current Lift the player is in. Can be null.
Declaration
public Lift Lift { get; }
Property Value
| Type | Description |
|---|---|
| Lift |
List
Gets a list of all Player's on the server.
Declaration
public static IReadOnlyCollection<Player> List { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<Player> |
MaxArtificialHealth
Gets or sets the player's maximum artificial health.
Declaration
public float MaxArtificialHealth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
MaxHealth
Gets or sets the player's maximum health.
Declaration
public float MaxHealth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
NetId
Gets the player's net ID.
Declaration
public uint NetId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
NetworkIdentity
Gets the player's Mirror.NetworkIdentity.
Declaration
public NetworkIdentity NetworkIdentity { get; }
Property Value
| Type | Description |
|---|---|
| Mirror.NetworkIdentity |
Nickname
Gets the player's nickname.
Declaration
public string Nickname { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Ping
Gets the player's ping.
Declaration
public int Ping { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Position
Gets or sets the player's position.
Declaration
public Vector3 Position { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Vector3 |
See Also
| Improve this Doc View SourcePreferences
Gets a System.Collections.Generic.Dictionary<TKey, TValue> which contains all player's preferences.
Declaration
public Dictionary<FirearmType, AttachmentIdentifier[]> Preferences { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<FirearmType, AttachmentIdentifier[]> |
RadioPlayback
Gets the ReferenceHub's VoiceChat.Playbacks.PersonalRadioPlayback, can be null.
Declaration
public PersonalRadioPlayback RadioPlayback { get; }
Property Value
| Type | Description |
|---|---|
| VoiceChat.Playbacks.PersonalRadioPlayback |
RankColor
Gets or sets the player's rank color.
Declaration
public string RankColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RankName
Gets or sets the player's rank name.
Declaration
public string RankName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RawUserId
Gets the player's user id without the authentication.
Declaration
public string RawUserId { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ReferenceHub
Gets the encapsulated ReferenceHub.
Declaration
public ReferenceHub ReferenceHub { get; }
Property Value
| Type | Description |
|---|---|
| ReferenceHub |
RelativePosition
Gets or sets the relative player's position.
Declaration
public RelativePosition RelativePosition { get; set; }
Property Value
| Type | Description |
|---|---|
| RelativePositioning.RelativePosition |
Remarks
The value will be default if the player's role is not an FpcRole.
RemoteAdminAccess
Gets a value indicating whether or not the player has Remote Admin access.
Declaration
public bool RemoteAdminAccess { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RemoteAdminPermissions
Gets or sets a value indicating the actual RA permissions.
Declaration
public PlayerPermissions RemoteAdminPermissions { get; set; }
Property Value
| Type | Description |
|---|---|
| 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).
Declaration
public Role Role { get; }
Property Value
| Type | Description |
|---|---|
| Role |
See Also
RoleManager
Gets the PlayerRoles.PlayerRoleManager.
Declaration
public PlayerRoleManager RoleManager { get; }
Property Value
| Type | Description |
|---|---|
| PlayerRoles.PlayerRoleManager |
Rotation
Gets or sets the player's rotation.
Declaration
public Quaternion Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Quaternion | Returns the direction the player is looking at. |
Scale
Gets or sets the player's scale.
Declaration
public Vector3 Scale { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Vector3 |
ScpPreferences
Gets or sets the player's SCP preferences.
Declaration
public ScpSpawnPreferences.SpawnPreferences ScpPreferences { get; set; }
Property Value
| Type | Description |
|---|---|
| PlayerRoles.RoleAssign.ScpSpawnPreferences.SpawnPreferences |
Sender
Gets the player's command sender instance.
Declaration
public PlayerCommandSender Sender { get; }
Property Value
| Type | Description |
|---|---|
| RemoteAdmin.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 System.Collections.Generic.Dictionary<TKey, TValue>. The key of the data is always a System.String, whereas the value can be any System.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.
Declaration
public Dictionary<string, object> SessionVariables { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Object> |
Stamina
Gets or sets the amount of stamina the player has.
Declaration
public float Stamina { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
This will always be a value between 0-1, 0 representing no stamina and 1 representing maximum stamina.
StaminaStat
Gets the StaminaStat class.
Declaration
public StaminaStat StaminaStat { get; }
Property Value
| Type | Description |
|---|---|
| PlayerStatsSystem.StaminaStat |
Transform
Gets the ReferenceHub's UnityEngine.Transform.
Declaration
public Transform Transform { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Transform |
UniqueRole
Gets or sets a unique custom role that does not adbide to base game for this player. Used in conjunction with CustomRoleFriendlyFireMultiplier.
Declaration
public string UniqueRole { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UnitId
Gets or sets the player's unit id.
Declaration
public byte UnitId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
UnitName
Gets the player's unit name.
Declaration
public string UnitName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
UserId
Gets the player's user id.
Declaration
public string UserId { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
UserIdsCache
Gets a System.Collections.Generic.Dictionary<TKey, TValue> containing cached Player and their user ids.
Declaration
public static Dictionary<string, Player> UserIdsCache { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, Player> |
Velocity
Gets the Player's current movement speed.
Declaration
public Vector3 Velocity { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Vector3 |
VoiceChannel
Gets or sets the player's voice channel.
Declaration
public VoiceChatChannel VoiceChannel { get; set; }
Property Value
| Type | Description |
|---|---|
| VoiceChat.VoiceChatChannel |
VoiceChatMuteFlags
Gets or sets the player's VoiceChat.VcMuteFlags.
Declaration
public VcMuteFlags VoiceChatMuteFlags { get; set; }
Property Value
| Type | Description |
|---|---|
| VoiceChat.VcMuteFlags |
VoiceColor
Gets the player's voice color.
Declaration
public Color VoiceColor { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Color |
VoiceModule
Gets the ReferenceHub's VoiceModule, can be null.
Declaration
public VoiceModuleBase VoiceModule { get; }
Property Value
| Type | Description |
|---|---|
| PlayerRoles.Voice.VoiceModuleBase |
Zone
Gets the current zone the player is in.
Declaration
public ZoneType Zone { get; }
Property Value
| Type | Description |
|---|---|
| ZoneType |
Methods
| Improve this Doc View SourceAddAhp(Single, Single, Single, Single, Single, Boolean)
Gives a new PlayerStatsSystem.AhpStat.
Declaration
public void AddAhp(float amount, float limit = 75F, float decay = 1.2F, float efficacy = 0.7F, float sustain = 0F, bool persistant = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | amount | The amount to give the player. |
| System.Single | limit | The maximum AHP for this stat. |
| System.Single | decay | How much value is lost per second. |
| System.Single | efficacy | Percent of incoming damage absorbed by this stat. |
| System.Single | sustain | The number of seconds to delay the start of the decay. |
| System.Boolean | persistant | Whether or not the process is removed when the value hits 0. |
AddAmmo(AmmoType, UInt16)
Adds the amount of a specified ammo type to the player's inventory.
Declaration
public void AddAmmo(AmmoType ammoType, ushort amount)
Parameters
| Type | Name | Description |
|---|---|---|
| AmmoType | ammoType | The AmmoType to be added. |
| System.UInt16 | amount | The amount of ammo to be added. |
AddAmmo(FirearmType, UInt16)
Adds the amount of a weapon's ammo type to the player's inventory.
Declaration
public void AddAmmo(FirearmType weaponType, ushort amount)
Parameters
| Type | Name | Description |
|---|---|---|
| FirearmType | weaponType | The ItemType of the weapon. |
| System.UInt16 | amount | The amount of ammo to be added. |
AddComponent(Type, String)
Declaration
public EActor AddComponent(Type type, string name = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| System.String | name |
Returns
| Type | Description |
|---|---|
| EActor |
AddComponent<T>(String)
Declaration
public T AddComponent<T>(string name = "")
where T : EActor
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
AddComponent<T>(Type, String)
Declaration
public T AddComponent<T>(Type type, string name = "")
where T : EActor
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| System.String | name |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
AddItem(FirearmType, IEnumerable<AttachmentIdentifier>)
Adds an firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
public Item AddItem(FirearmType firearmType, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| FirearmType | firearmType | The firearm to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
Returns
| Type | Description |
|---|---|
| Item | The Item given to the player. |
AddItem(FirearmType, Int32, IEnumerable<AttachmentIdentifier>)
Adds the amount of firearms of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
public IEnumerable<Item> AddItem(FirearmType firearmType, int amount, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| FirearmType | firearmType | The item to be added. |
| System.Int32 | amount | The amount of items to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.IEnumerable<T> containing the items given. |
AddItem(Firearm, IEnumerable<AttachmentIdentifier>)
Adds an item to the player's inventory.
Declaration
public void AddItem(Firearm item, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Firearm | item | The item to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
AddItem(Firearm, Int32, IEnumerable<AttachmentIdentifier>)
Adds the amount of items to the player's inventory.
Declaration
[Obsolete("Removed this method can't be functional")]
public void AddItem(Firearm firearm, int amount, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| Firearm | firearm | The firearm to be added. |
| System.Int32 | amount | The amount of items to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
AddItem(Item)
Adds an item to the player's inventory.
Declaration
public void AddItem(Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The item to be added. |
AddItem(Item, Int32)
Adds the amount of items to the player's inventory.
Declaration
[Obsolete("Removed this method can't be functional")]
public void AddItem(Item item, int amount)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The item to be added. |
| System.Int32 | amount | The amount of items to be added. |
AddItem(FirearmPickup, IEnumerable<AttachmentIdentifier>)
Adds an item to the player's inventory.
Declaration
public Item AddItem(FirearmPickup pickup, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| FirearmPickup | pickup | The FirearmPickup of the item to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to Pickup of the item. |
Returns
| Type | Description |
|---|---|
| Item | The Item that was added. |
AddItem(Pickup)
Adds an item to the player's inventory.
Declaration
public Item AddItem(Pickup pickup)
Parameters
| Type | Name | Description |
|---|---|---|
| Pickup | pickup | The Pickup of the item to be added. |
Returns
| Type | Description |
|---|---|
| Item | The Item that was added. |
AddItem(ItemBase, Item)
Adds an item to the player's inventory.
Declaration
public Item AddItem(ItemBase itemBase, Item item = null)
Parameters
| Type | Name | Description |
|---|---|---|
| InventorySystem.Items.ItemBase | itemBase | The item to be added. |
| Item | item | The Item object of the item. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public Item AddItem(ItemType itemType)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | itemType | The item to be added. |
Returns
| Type | Description |
|---|---|
| Item | The Item given to the player. |
AddItem(ItemType, IEnumerable<AttachmentIdentifier>)
Adds an item of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
[Obsolete("Use AddItem(ItemType) or AddItem(FirearmType, IEnumerable<AttachmentIdentifier>)", true)]
public Item AddItem(ItemType itemType, IEnumerable<AttachmentIdentifier> identifiers = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | itemType | The item to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
Returns
| Type | Description |
|---|---|
| Item | The Item given to the player. |
AddItem(ItemType, Int32)
Adds the amount of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
public IEnumerable<Item> AddItem(ItemType itemType, int amount)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | itemType | The item to be added. |
| System.Int32 | amount | The amount of items to be added. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.IEnumerable<T> containing the items given. |
AddItem(ItemType, Int32, IEnumerable<AttachmentIdentifier>)
Adds the amount of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
[Obsolete("Use AddItem(ItemType, int) or AddItem(FirearmType, int, IEnumerable<AttachmentIdentifier>)", true)]
public IEnumerable<Item> AddItem(ItemType itemType, int amount, IEnumerable<AttachmentIdentifier> identifiers)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | itemType | The item to be added. |
| System.Int32 | amount | The amount of items to be added. |
| System.Collections.Generic.IEnumerable<AttachmentIdentifier> | identifiers | The attachments to be added to the item. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.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.
Declaration
public IEnumerable<Item> AddItem(Dictionary<FirearmType, IEnumerable<AttachmentIdentifier>> items)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<FirearmType, System.Collections.Generic.IEnumerable<AttachmentIdentifier>> | items | The System.Collections.Generic.Dictionary<TKey, TValue> of ItemType and System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to be added. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.IEnumerable<T> containing the items given. |
AddItem(Dictionary<Firearm, IEnumerable<AttachmentIdentifier>>)
Adds the list of items to the player's inventory.
Declaration
public void AddItem(Dictionary<Firearm, IEnumerable<AttachmentIdentifier>> firearms)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<Firearm, System.Collections.Generic.IEnumerable<AttachmentIdentifier>> | firearms | The System.Collections.Generic.Dictionary<TKey, TValue> of Firearm and System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to be added. |
AddItem(Dictionary<ItemType, IEnumerable<AttachmentIdentifier>>)
Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory.
Declaration
[Obsolete("Use AddItem(Dictionary<FirearmType, IEnumerable<AttachmentIdentifier>>) instead of this", true)]
public IEnumerable<Item> AddItem(Dictionary<ItemType, IEnumerable<AttachmentIdentifier>> items)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<ItemType, System.Collections.Generic.IEnumerable<AttachmentIdentifier>> | items | The System.Collections.Generic.Dictionary<TKey, TValue> of ItemType and System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to be added. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.IEnumerable<T> containing the items given. |
AddItem(IEnumerable<Item>)
Adds the list of items to the player's inventory.
Declaration
public void AddItem(IEnumerable<Item> items)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Item> | items | 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.
Declaration
public IEnumerable<Item> AddItem(IEnumerable<ItemType> items)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ItemType> | items | The list of items to be added. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Item> | An System.Collections.Generic.IEnumerable<T> containing the items given. |
AddReservedSlot(String)
Adds a player's UserId to the list of reserved slots.
Declaration
public static bool AddReservedSlot(string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The UserId of the player to add. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the slot was successfully added, or false if the provided UserId already has a reserved slot. |
Remarks
This method does not permanently give a user a reserved slot. The slot will be removed if the reserved slots are reloaded.
See Also
| Improve this Doc View SourceAddReservedSlot(String, Boolean)
Adds a player's UserId to the list of reserved slots.
Declaration
public static bool AddReservedSlot(string userId, bool isPermanent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The UserId of the player to add. |
| System.Boolean | isPermanent | Whether or not to add a langword_csharp_userId permanently. It will write a langword_csharp_userId to UserIDReservedSlots.txt file. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the slot was successfully added, or false if the provided UserId already has a reserved slot. |
See Also
| Improve this Doc View SourceAddToWhitelist(String, Boolean)
Adds a player's UserId to the whitelist.
Declaration
public static bool AddToWhitelist(string userId, bool isPermanent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userId | The UserId of the player to add. |
| System.Boolean | isPermanent | Whether or not to add a langword_csharp_userId permanently. It will write a langword_csharp_userId to UserIDWhitelist.txt file. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the record was successfully added, or false if the provided UserId already is in whitelist. |
See Also
| Improve this Doc View SourceApplyRandomEffect(EffectCategory, Byte, Single, Boolean)
Enables a random EffectType on the player.
Declaration
public EffectType ApplyRandomEffect(EffectCategory category, byte intensity, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectCategory | category | An optional category to filter the applied effect. Set to None for any effect. |
| System.Byte | intensity | The intensity of the effect will be active for. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| EffectType | A EffectType that was given to the player. |
ApplyRandomEffect(EffectCategory, Single, Boolean)
Enables a random EffectType on the player.
Declaration
public EffectType ApplyRandomEffect(EffectCategory category = EffectCategory.None, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectCategory | category | An optional category to filter the applied effect. Set to None for any effect. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| EffectType | A EffectType that was given to the player. |
Ban(Int32, String, Player)
Bans the player.
Declaration
public void Ban(int duration, string reason, Player issuer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | duration | The ban duration, in seconds. |
| System.String | reason | The ban reason. |
| Player | issuer | The ban issuer. |
Ban(TimeSpan, String, Player)
Bans the player.
Declaration
public void Ban(TimeSpan duration, string reason, Player issuer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | duration | The length of time to ban. |
| System.String | reason | The ban reason. |
| Player | issuer | The ban issuer. |
BlinkTag()
Blink the player's tag.
Declaration
public IEnumerator<float> BlinkTag()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<System.Single> | Used to wait. |
Broadcast(Broadcast, Boolean)
Broadcasts the given Broadcast to the player.
Declaration
public void Broadcast(Broadcast broadcast, bool shouldClearPrevious = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Broadcast | broadcast | The Broadcast to be broadcasted. |
| System.Boolean | shouldClearPrevious | Clears all player's broadcasts before sending the new one. |
Broadcast(UInt16, String, Broadcast.BroadcastFlags, Boolean)
Shows a broadcast to the player. Doesn't get logged to the console and can be monospaced.
Declaration
public void Broadcast(ushort duration, string message, Broadcast.BroadcastFlags type = Broadcast.BroadcastFlags.Normal, bool shouldClearPrevious = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | duration | The broadcast duration. |
| System.String | message | The message to be broadcasted. |
| Broadcast.BroadcastFlags | type | The broadcast type. |
| System.Boolean | shouldClearPrevious | Clears all player's broadcasts before sending the new one. |
ChangeEffectIntensity(EffectType, Byte, Single)
Changes the intensity of a CustomPlayerEffects.StatusEffectBase.
Declaration
public void ChangeEffectIntensity(EffectType type, byte intensity, float duration = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | type | The EffectType to change. |
| System.Byte | intensity | The new intensity to use. |
| System.Single | duration | The new duration to add to the effect. |
ChangeEffectIntensity(String, Byte, Single)
Changes the intensity of a CustomPlayerEffects.StatusEffectBase.
Declaration
public void ChangeEffectIntensity(string effectName, byte intensity, float duration = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | effectName | The name of the CustomPlayerEffects.StatusEffectBase to enable. |
| System.Byte | intensity | The intensity of the effect. |
| System.Single | duration | The new length of the effect. Defaults to infinite length. |
ChangeEffectIntensity<T>(Byte, Single)
Changes the intensity of a CustomPlayerEffects.StatusEffectBase.
Declaration
public void ChangeEffectIntensity<T>(byte intensity, float duration = 0F)
where T : StatusEffectBase
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | intensity | The intensity of the effect. |
| System.Single | duration | The new duration to add to the effect. |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to change the intensity of. |
ClearAmmo()
Clears all ammo in the inventory.
Declaration
public void ClearAmmo()
See Also
| Improve this Doc View SourceClearBroadcasts()
Clears the player's brodcast. Doesn't get logged to the console.
Declaration
public void ClearBroadcasts()
ClearInventory(Boolean)
Clears the player's inventory, including all ammo and items.
Declaration
public void ClearInventory(bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | destroy | Whether or not to fully destroy the old items. |
See Also
| Improve this Doc View SourceClearItems(Boolean)
Clears the player's items.
Declaration
public void ClearItems(bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | destroy | Whether or not to fully destroy the old items. |
See Also
| Improve this Doc View SourceCountItem(ProjectileType)
Counts how many items of a certain ProjectileType a player has.
Declaration
public int CountItem(ProjectileType grenadeType)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | grenadeType | The ProjectileType to search for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | How many items of that ProjectileType the player has. |
See Also
| Improve this Doc View SourceCountItem(ItemCategory)
Counts how many items of a certain ItemCategory a player has.
Declaration
public int CountItem(ItemCategory category)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemCategory | category | The category to search for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | How many items of that ItemCategory the player has. |
See Also
| Improve this Doc View SourceCountItem(ItemType)
Counts how many items of a certain ItemType a player has.
Declaration
public int CountItem(ItemType item)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | item | The item to search for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | How many items of that ItemType the player has. |
Remarks
For counting ammo, see GetAmmo(AmmoType).
See Also
| Improve this Doc View SourceDisableAllEffects()
Disables all currently active CustomPlayerEffects.StatusEffectBase.
Declaration
public void DisableAllEffects()
See Also
| Improve this Doc View SourceDisableAllEffects(EffectCategory)
Disables all currently active CustomPlayerEffects.StatusEffectBase.
Declaration
public void DisableAllEffects(EffectCategory category)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectCategory | category | A category to filter the disabled effects. |
See Also
| Improve this Doc View SourceDisableEffect(EffectType)
Disables a specific status effect on the player.
Declaration
public void DisableEffect(EffectType effect)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | effect | The EffectType to disable. |
DisableEffect<T>()
Disables a specific CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public void DisableEffect<T>()
where T : StatusEffectBase
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to disable. |
DisableEffects(IEnumerable<EffectType>)
Disables a System.Collections.Generic.IEnumerable<T> of EffectType on the player.
Declaration
public void DisableEffects(IEnumerable<EffectType> effects)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<EffectType> | effects | The System.Collections.Generic.IEnumerable<T> of EffectType to disable. |
Disconnect(String)
Disconnects the player.
Declaration
public void Disconnect(string reason = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | reason | The disconnection reason. |
DropAmmo(AmmoType, UInt16, Boolean)
Drops a specific AmmoType out of the player's inventory.
Declaration
public bool DropAmmo(AmmoType ammoType, ushort amount, bool checkMinimals = false)
Parameters
| Type | Name | Description |
|---|---|---|
| AmmoType | ammoType | The AmmoType that will be dropped. |
| System.UInt16 | amount | The amount of ammo that will be dropped. |
| System.Boolean | checkMinimals | Whether or not ammo limits will be taken into consideration. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if ammo was dropped; otherwise, false. |
DropHeldItem()
Drops the held item. Will not do anything if the player is not holding an item.
Declaration
public Pickup DropHeldItem()
Returns
| Type | Description |
|---|---|
| Pickup | Dropped item's Pickup. |
See Also
| Improve this Doc View SourceDropHeldItem(Boolean)
Drops the held item. Will not do anything if the player is not holding an item.
Declaration
public void DropHeldItem(bool isThrown = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isThrown | Is the item Thrown?. |
DropItem(Item)
Drops an item from the player's inventory.
Declaration
public Pickup DropItem(Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The Item to be dropped. |
Returns
| Type | Description |
|---|---|
| Pickup | dropped Pickup. |
DropItem(Item, Boolean)
Drops an item from the player's inventory.
Declaration
public void DropItem(Item item, bool isThrown = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The Item to be dropped. |
| System.Boolean | isThrown | Is the item Thrown?. |
DropItems()
Drops all items in the player's inventory, including all ammo and items.
Declaration
public void DropItems()
See Also
| Improve this Doc View SourceEnableEffect(StatusEffectBase, Byte, Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public bool EnableEffect(StatusEffectBase statusEffect, byte intensity, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| CustomPlayerEffects.StatusEffectBase | statusEffect | The name of the CustomPlayerEffects.StatusEffectBase to enable. |
| System.Byte | intensity | The intensity of the effect will be active for. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the effect was valid and successfully enabled. |
EnableEffect(StatusEffectBase, Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public bool EnableEffect(StatusEffectBase statusEffect, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| CustomPlayerEffects.StatusEffectBase | statusEffect | The name of the CustomPlayerEffects.StatusEffectBase to enable. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the effect was valid and successfully enabled. |
EnableEffect(EffectType, Byte, Single, Boolean)
Enables a status effect on the player.
Declaration
public bool EnableEffect(EffectType type, byte intensity, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | type | The EffectType to enable. |
| System.Byte | intensity | The intensity of the effect will be active for. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | return if the effect has been Enable. |
EnableEffect(EffectType, Single, Boolean)
Enables a status effect on the player.
Declaration
public void EnableEffect(EffectType type, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | type | The EffectType to enable. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
EnableEffect(Effect)
Enables a status effect on the player.
Declaration
[Obsolete("Use SyncEffect(Effect) instead of this")]
public void EnableEffect(Effect effect)
Parameters
| Type | Name | Description |
|---|---|---|
| Effect | effect | The Effect to enable. |
EnableEffect(String, Byte, Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public StatusEffectBase EnableEffect(string effectName, byte intensity, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | effectName | The name of the CustomPlayerEffects.StatusEffectBase to enable. |
| System.Byte | intensity | The intensity of the effect will be active for. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| CustomPlayerEffects.StatusEffectBase | The CustomPlayerEffects.StatusEffectBase instance of the activated effect. |
EnableEffect(String, Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public StatusEffectBase EnableEffect(string effectName, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | effectName | The name of the CustomPlayerEffects.StatusEffectBase to enable. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| CustomPlayerEffects.StatusEffectBase | The CustomPlayerEffects.StatusEffectBase instance of the activated effect. |
EnableEffect<T>(Byte, Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public bool EnableEffect<T>(byte intensity, float duration = 0F, bool addDurationIfActive = false)
where T : StatusEffectBase
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | intensity | The intensity of the effect will be active for. |
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the effect was valid and successfully enabled. |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to enable. |
EnableEffect<T>(Single, Boolean)
Enables a CustomPlayerEffects.StatusEffectBase on the player.
Declaration
public bool EnableEffect<T>(float duration = 0F, bool addDurationIfActive = false)
where T : StatusEffectBase
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | duration | The amount of time the effect will be active for. |
| System.Boolean | addDurationIfActive | If the effect is already active, setting to true will add this duration onto the effect. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the effect was valid and successfully enabled. |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to enable. |
EnableEffects(IEnumerable<EffectType>, Single, Boolean)
Enables a System.Collections.Generic.IEnumerable<T> of EffectType on the player.
Declaration
public void EnableEffects(IEnumerable<EffectType> types, float duration = 0F, bool addDurationIfActive = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<EffectType> | types | The System.Collections.Generic.IEnumerable<T> of EffectType to enable. |
| System.Single | duration | The amount of time the effects will be active for. |
| System.Boolean | addDurationIfActive | If an effect is already active, setting to true will add this duration onto the effect. |
EnableEffects(IEnumerable<Effect>)
Enables a System.Collections.Generic.IEnumerable<T> of Effect on the player.
Declaration
[Obsolete("Use SyncEffects(IEnumerable<Effect>) instead of this")]
public void EnableEffects(IEnumerable<Effect> effects)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Effect> | effects | The System.Collections.Generic.IEnumerable<T> of Effect to enable. |
Explode()
Explode the player.
Declaration
public void Explode()
Explode(ProjectileType, Player)
Explode the player.
Declaration
public void Explode(ProjectileType projectileType, Player attacker = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | projectileType | The projectile that will create the explosion. |
| Player | attacker | The Player that will causing the explosion. |
ExplodeEffect(ProjectileType)
Spawn projectile effect on the player.
Declaration
public void ExplodeEffect(ProjectileType projectileType)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | projectileType | The projectile that will create the effect. |
Finalize()
Finalizes an instance of the Player class.
Declaration
protected void Finalize()
Get(CommandSender)
Gets the Player belonging to the CommandSender, if any.
Declaration
public static Player Get(CommandSender sender)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandSender | sender | The command sender. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(ICommandSender)
Gets the Player belonging to the CommandSystem.ICommandSender, if any.
Declaration
public static Player Get(ICommandSender sender)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandSystem.ICommandSender | sender | The command sender. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(Side)
Gets a Player System.Collections.Generic.IEnumerable<T> filtered by side. Can be empty.
Declaration
public static IEnumerable<Player> Get(Side side)
Parameters
| Type | Name | Description |
|---|---|---|
| Side | side | The players' side. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Player> | The filtered System.Collections.Generic.IEnumerable<T>. |
Get(Footprint)
Gets the Player belonging to the Footprinting.Footprint, if any.
Declaration
public static Player Get(Footprint footprint)
Parameters
| Type | Name | Description |
|---|---|---|
| Footprinting.Footprint | footprint | The Footprint. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(NetworkConnection)
Gets the Player belonging to a specific Mirror.NetworkConnection, if any.
Declaration
public static Player Get(NetworkConnection conn)
Parameters
| Type | Name | Description |
|---|---|---|
| Mirror.NetworkConnection | conn | The player's Mirror.NetworkConnection. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public static Player Get(NetworkIdentity netIdentity)
Parameters
| Type | Name | Description |
|---|---|---|
| Mirror.NetworkIdentity | netIdentity | The player's Mirror.NetworkIdentity. |
Returns
| Type | Description |
|---|---|
| Player | The Player owning the Mirror.NetworkIdentity, or null if not found. |
Get(RoleTypeId)
Gets a Player System.Collections.Generic.IEnumerable<T> filtered by role. Can be empty.
Declaration
public static IEnumerable<Player> Get(RoleTypeId role)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.RoleTypeId | role | The players' role. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Player> | The filtered System.Collections.Generic.IEnumerable<T>. |
Get(Team)
Gets a Player System.Collections.Generic.IEnumerable<T> filtered by team. Can be empty.
Declaration
public static IEnumerable<Player> Get(Team team)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.Team | team | The players' team. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Player> | The filtered System.Collections.Generic.IEnumerable<T>. |
Get(Player)
Gets the Player from NwPluginAPI class.
Declaration
public static Player Get(Player apiPlayer)
Parameters
| Type | Name | Description |
|---|---|---|
| PluginAPI.Core.Player | apiPlayer | The PluginAPI.Core.Player class. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(ReferenceHub)
Gets the Player belonging to the ReferenceHub, if any.
Declaration
public static Player Get(ReferenceHub referenceHub)
Parameters
| Type | Name | Description |
|---|---|---|
| ReferenceHub | referenceHub | The player's ReferenceHub. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(Func<Player, Boolean>)
Gets a System.Collections.Generic.IEnumerable<T> of Player filtered based on a predicate.
Declaration
public static IEnumerable<Player> Get(Func<Player, bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<Player, System.Boolean> | predicate | The condition to satisfy. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Player> | A System.Collections.Generic.IEnumerable<T> of Player which contains elements that satisfy the condition. |
Get(Int32)
Gets the player belonging to the specified id.
Declaration
public static Player Get(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The player id. |
Returns
| Type | Description |
|---|---|
| Player | Returns the player found or null if not found. |
Get(String)
Gets the Player by identifier.
Declaration
public static Player Get(string args)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | args | The player's nickname, ID, steamID64 or Discord ID. |
Returns
| Type | Description |
|---|---|
| Player | Returns the player found or null if not found. |
Get(UInt32)
Gets the Player belonging to a specific netId, if any.
Declaration
public static Player Get(uint netId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | netId | The player's Mirror.NetworkIdentity.netId. |
Returns
| Type | Description |
|---|---|
| Player | The Player owning the netId, or null if not found. |
Get(Collider)
Gets the Player belonging to the UnityEngine.Collider, if any.
Declaration
public static Player Get(Collider collider)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Collider | collider | UnityEngine.Collider. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
Get(GameObject)
Gets the Player belonging to the UnityEngine.GameObject, if any.
Declaration
public static Player Get(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.GameObject | gameObject | The player's UnityEngine.GameObject. |
Returns
| Type | Description |
|---|---|
| Player | A Player or null if not found. |
GetAmmo(AmmoType)
Gets the ammo count of a specified ammo type in a player's inventory.
Declaration
public ushort GetAmmo(AmmoType ammoType)
Parameters
| Type | Name | Description |
|---|---|---|
| AmmoType | ammoType | The AmmoType to be searched for in the player's inventory. |
Returns
| Type | Description |
|---|---|
| System.UInt16 | The specified ammo count. |
GetAmmoLimit(AmmoType)
Gets the maximum amount of ammo the player can hold, given the ammo AmmoType. This method factors in the armor the player is wearing, as well as server configuration. For the maximum amount of ammo that can be given regardless of worn armor and server configuration, see ServerConfigSynchronizer.AmmoLimit.
Declaration
public int GetAmmoLimit(AmmoType type)
Parameters
| Type | Name | Description |
|---|---|---|
| AmmoType | type | The AmmoType of the ammo to check. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The maximum amount of ammo this player can carry. Guaranteed to be between |
GetCategoryLimit(ItemCategory)
Gets the maximum amount of an ItemCategory the player can hold, based on the armor the player is wearing, as well as server configuration.
Declaration
public int GetCategoryLimit(ItemCategory category)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemCategory | category | The ItemCategory to check. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The maximum amount of items in the category that the player can hold. |
GetComponent(Type)
Declaration
public EActor GetComponent(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type |
Returns
| Type | Description |
|---|---|
| EActor |
GetComponent<T>()
Declaration
public T GetComponent<T>()
where T : EActor
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetComponent<T>(Type)
Declaration
public T GetComponent<T>(Type type)
where T : EActor
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCooldownItem(ItemType)
Get the time cooldown on this ItemType.
Declaration
public float GetCooldownItem(ItemType itemType)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | itemType | The itemtypes to choose for getting cooldown. |
Returns
| Type | Description |
|---|---|
| System.Single | Return the time in seconds of the cooldowns. |
GetEffect(EffectType)
Gets an instance of CustomPlayerEffects.StatusEffectBase by EffectType.
Declaration
public StatusEffectBase GetEffect(EffectType effectType)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | effectType | The EffectType. |
Returns
| Type | Description |
|---|---|
| CustomPlayerEffects.StatusEffectBase | The CustomPlayerEffects.StatusEffectBase. |
GetEffectIntensity<T>()
Gets a System.Byte indicating the intensity of the given CustomPlayerEffects.StatusEffectBase.
Declaration
public byte GetEffectIntensity<T>()
where T : StatusEffectBase
Returns
| Type | Description |
|---|---|
| System.Byte | The intensity of the effect. |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to check. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if the given type is not a valid CustomPlayerEffects.StatusEffectBase. |
GetModule<T>()
Gets a PlayerStatsSystem.StatBase module from the player's PlayerStatsSystem.PlayerStats component.
Declaration
public T GetModule<T>()
where T : StatBase
Returns
| Type | Description |
|---|---|
| T | The |
Type Parameters
| Name | Description |
|---|---|
| T | The returned object type. |
GetNearCameras(Single)
Declaration
public IEnumerable<Camera> GetNearCameras(float toleration = 15F)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | toleration |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Camera> |
GetScpPreference(RoleTypeId)
Gets a user's SCP preference.
Declaration
public int GetScpPreference(RoleTypeId roleType)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.RoleTypeId | roleType | The SCP RoleType. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A value from |
GiveReservedSlot()
Adds the player's UserId to the list of reserved slots.
Declaration
public bool GiveReservedSlot()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the slot was successfully added, or false if the player already has a reserved slot. |
Remarks
This method does not permanently give a user a reserved slot. The slot will be removed if the reserved slots are reloaded.
See Also
| Improve this Doc View SourceGiveReservedSlot(Boolean)
Adds a player's UserId to the list of reserved slots.
Declaration
public bool GiveReservedSlot(bool isPermanent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isPermanent | Whether or not to add a player's UserId permanently. It will write a player's UserId to UserIDReservedSlots.txt file. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the slot was successfully added, or false if the provided UserId already has a reserved slot. |
See Also
| Improve this Doc View SourceGrantWhitelist(Boolean)
Adds a player's UserId to the whitelist.
Declaration
public bool GrantWhitelist(bool isPermanent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isPermanent | Whether or not to add a player's UserId permanently. It will write a player's UserId to UserIDWhitelist.txt file. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the record was successfully added, or false if the provided UserId already is in whitelist. |
See Also
| Improve this Doc View SourceHandcuff()
Handcuff the player as administrator.
Declaration
public void Handcuff()
Handcuff(Player)
Handcuff the player.
Declaration
public void Handcuff(Player cuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | cuffer | The cuffer player. |
HasComponent(Type, Boolean)
Declaration
public bool HasComponent(Type type, bool depthInheritance = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| System.Boolean | depthInheritance |
Returns
| Type | Description |
|---|---|
| System.Boolean |
HasComponent<T>(Boolean)
Declaration
public bool HasComponent<T>(bool depthInheritance = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | depthInheritance |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Type Parameters
| Name | Description |
|---|---|
| T |
HasItem(Item)
Indicates whether or not the player has an item.
Declaration
public bool HasItem(Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The item to search for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if the player has it; otherwise, false. |
HasItem(ItemType)
Indicates whether or not the player has an item type.
Declaration
public bool HasItem(ItemType type)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | The type to search for. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if the player has it; otherwise, false. |
Heal(Single, Boolean)
Heals the player.
Declaration
public void Heal(float amount, bool overrideMaxHealth = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | amount | The amount of health to heal. |
| System.Boolean | overrideMaxHealth | Whether or not healing should exceed their max health. |
Hurt(Player, Single, DamageType, DamageHandlerBase.CassieAnnouncement)
Hurts the player.
Declaration
public void Hurt(Player attacker, float amount, DamageType damageType = DamageType.Unknown, DamageHandlerBase.CassieAnnouncement cassieAnnouncement = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | attacker | The Player attacking player. |
| System.Single | amount | The langword_csharp_float amount of damage to deal. |
| DamageType | damageType | The DamageType of the damage dealt. |
| DamageHandlerBase.CassieAnnouncement | cassieAnnouncement | The DamageHandlerBase.CassieAnnouncement cassie announcement to make if the damage kills the player. |
Hurt(Player, Single, DamageType, DamageHandlerBase.CassieAnnouncement, String)
Hurts the player.
Declaration
public void Hurt(Player attacker, float amount, DamageType damageType = DamageType.Unknown, DamageHandlerBase.CassieAnnouncement cassieAnnouncement = null, string deathText = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | attacker | The Player attacking player. |
| System.Single | amount | The langword_csharp_float amount of damage to deal. |
| DamageType | damageType | The DamageType of the damage dealt. |
| DamageHandlerBase.CassieAnnouncement | cassieAnnouncement | The DamageHandlerBase.CassieAnnouncement cassie announcement to make if the damage kills the player. |
| System.String | deathText | The langword_csharp_string death text to appear on Player screen. |
Hurt(Player, Single, Vector3, Int32)
Hurts the player.
Declaration
public void Hurt(Player attacker, float damage, Vector3 force = default(Vector3), int armorPenetration = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | attacker | The Player attacking player. |
| System.Single | damage | The langword_csharp_float amount of damage to deal. |
| UnityEngine.Vector3 | force | The throw force. |
| System.Int32 | armorPenetration | The armor penetration amount. |
Hurt(DamageHandlerBase)
Hurts the player.
Declaration
public void Hurt(DamageHandlerBase damageHandlerBase)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerStatsSystem.DamageHandlerBase | damageHandlerBase | The PlayerStatsSystem.DamageHandlerBase used to deal damage. |
Hurt(Single, DamageType, String)
Hurts the player.
Declaration
public void Hurt(float amount, DamageType damageType = DamageType.Unknown, string cassieAnnouncement = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | amount | The langword_csharp_float amount of damage to deal. |
| DamageType | damageType | The DamageType of the damage dealt. |
| System.String | cassieAnnouncement | The langword_csharp_string cassie announcement to make if the damage kills the player. |
Hurt(Single, String, String)
Hurts the player.
Declaration
public void Hurt(float damage, string damageReason, string cassieAnnouncement = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | damage | The amount of damage to deal. |
| System.String | damageReason | The reason for the damage being dealt. |
| System.String | cassieAnnouncement | The cassie announcement to make. |
IsEffectActive<T>()
Gets a System.Boolean describing whether or not the given CustomPlayerEffects.StatusEffectBase is currently enabled.
Declaration
public bool IsEffectActive<T>()
where T : StatusEffectBase
Returns
| Type | Description |
|---|---|
| System.Boolean | A System.Boolean determining whether or not the player effect is active. |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to check. |
Kick(String, Player)
Kicks the player.
Declaration
public void Kick(string reason, Player issuer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | reason | The kick reason. |
| Player | issuer | The kick issuer. |
Kill(DamageType, String)
Kills the player.
Declaration
public void Kill(DamageType damageType, string cassieAnnouncement = "")
Parameters
| Type | Name | Description |
|---|---|---|
| DamageType | damageType | The DamageType the player has been killed. |
| System.String | cassieAnnouncement | The cassie announcement to make upon death. |
Kill(DamageHandlerBase)
Kills the player.
Declaration
public void Kill(DamageHandlerBase damageHandlerBase)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerStatsSystem.DamageHandlerBase | damageHandlerBase | The PlayerStatsSystem.DamageHandlerBase. |
Kill(String, String)
Kills the player.
Declaration
public void Kill(string deathReason, string cassieAnnouncement = "")
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | deathReason | The reason the player has been killed. |
| System.String | cassieAnnouncement | The cassie announcement to make upon death. |
Mute(Boolean)
Persistently mutes the player. For temporary mutes, see IsMuted and IsIntercomMuted.
Declaration
public void Mute(bool isIntercom = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isIntercom | Whether or not this mute is for the intercom only. |
OpenReportWindow(String)
Opens the report window.
Declaration
public void OpenReportWindow(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to send. |
PlaceBlood(Vector3)
Declaration
public void PlaceBlood(Vector3 direction)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | direction |
PlaceTantrum(Boolean)
Places a Tantrum (SCP-173's ability) under the player.
Declaration
public TantrumHazard PlaceTantrum(bool isActive = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isActive | Whether or not the tantrum will apply the Stained effect. |
Returns
| Type | Description |
|---|---|
| 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)
Declaration
public void PlayGunSound(ItemType type, byte volume, byte audioClipId = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | |
| System.Byte | volume | |
| System.Byte | audioClipId |
PlayShieldBreakSound()
Plays the Hume Shield break sound effect from the player.
Declaration
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.
Declaration
public void RandomTeleport(IEnumerable<Type> types)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Type> | types | The list of object types to choose from. |
RandomTeleport(Type)
Teleports player to a random object of a specific type.
Declaration
public void RandomTeleport(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | Object for teleport. |
RandomTeleport<T>()
Teleports player to a random object of a specific type.
Declaration
public void RandomTeleport<T>()
Type Parameters
| Name | Description |
|---|---|
| T | Object for teleport. |
Reconnect(UInt16, Single, Boolean, RoundRestartType)
Reconnects the player to the server. Can be used to redirect them to another server on a different port but same IP.
Declaration
public void Reconnect(ushort newPort = 0, float delay = 5F, bool reconnect = true, RoundRestartType roundRestartType = RoundRestartType.FullRestart)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | newPort | New port. |
| System.Single | delay | Player reconnection delay. |
| System.Boolean | reconnect | Whether or not player should be reconnected. |
| RoundRestarting.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.
Declaration
public static void ReloadReservedSlots()
ReloadWeapon()
Forces the player to reload their current weapon.
Declaration
public bool ReloadWeapon()
Returns
| Type | Description |
|---|---|
| System.Boolean | 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.
Declaration
public static void ReloadWhitelist()
RemoteAdminMessage(String, Boolean, String)
Sends a message to the player's Remote Admin console.
Declaration
public void RemoteAdminMessage(string message, bool success = true, string pluginName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to be sent. |
| System.Boolean | success | Indicates whether or not the message should be highlighted as success. |
| System.String | pluginName | The plugin name. |
RemoveHandcuffs()
Removes the player's handcuffs.
Declaration
public void RemoveHandcuffs()
RemoveHeldItem(Boolean)
Removes the held InventorySystem.Items.ItemBase from the player's inventory.
Declaration
public bool RemoveHeldItem(bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | destroy | Whether or not to destroy the item. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns a value indicating whether or not the InventorySystem.Items.ItemBase was removed. |
RemoveItem(Item, Boolean)
Removes an Item from the player's inventory.
Declaration
public bool RemoveItem(Item item, bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The Item to remove. |
| System.Boolean | destroy | Whether or not to destroy the item. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A value indicating whether or not the Item was removed. |
RemoveItem(Func<Item, Boolean>, Boolean)
Removes all Item's that satisfy the condition from the player's inventory.
Declaration
public int RemoveItem(Func<Item, bool> predicate, bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<Item, System.Boolean> | predicate | The condition to satisfy. |
| System.Boolean | destroy | Whether or not to destroy the items. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Count of a successfully removed Item's. |
RemoveItem(UInt16, Boolean)
Removes an Item from the player's inventory.
Declaration
public bool RemoveItem(ushort serial, bool destroy = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | serial | The Item serial to remove. |
| System.Boolean | destroy | Whether or not to destroy the item. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A value indicating whether or not the Item was removed. |
ResetInventory(IEnumerable<Item>)
Resets the player's inventory to the provided list of items, clearing any items it already possess.
Declaration
public void ResetInventory(IEnumerable<Item> newItems)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Item> | newItems | 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.
Declaration
public void ResetInventory(IEnumerable<ItemType> newItems)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<ItemType> | newItems | The new items that have to be added to the inventory. |
ResetStamina()
Resets the Player's stamina.
Declaration
public void ResetStamina()
SendConsoleMessage(String, String)
Sends a console message to the player's console.
Declaration
public void SendConsoleMessage(string message, string color)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to be sent. |
| System.String | color | The message color. |
SendStaffMessage(String, EncryptedChannelManager.EncryptedChannel)
Sends a message to the player's Remote Admin Chat.
Declaration
public bool SendStaffMessage(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannelManager.EncryptedChannel.AdminChat)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to be sent. |
| EncryptedChannelManager.EncryptedChannel | channel | Indicates whether or not the message should be highlighted as success. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if message was send; otherwise, false. |
SendStaffPing(String, EncryptedChannelManager.EncryptedChannel)
Sends a message to the player's Remote Admin Chat.
Declaration
public bool SendStaffPing(string message, EncryptedChannelManager.EncryptedChannel channel = EncryptedChannelManager.EncryptedChannel.AdminChat)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to be sent. |
| EncryptedChannelManager.EncryptedChannel | channel | Indicates whether or not the message should be highlighted as success. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if message was send; otherwise, false. |
SetAmmo(AmmoType, UInt16)
Sets the amount of a specified ammo type to the player's inventory.
Declaration
public void SetAmmo(AmmoType ammoType, ushort amount)
Parameters
| Type | Name | Description |
|---|---|---|
| AmmoType | ammoType | The AmmoType to be set. |
| System.UInt16 | amount | The amount of ammo to be set. |
SetCooldownItem(Single, ItemType)
Set the time cooldown on this ItemType.
Declaration
public void SetCooldownItem(float time, ItemType itemType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | time | The times for the cooldown. |
| ItemType | itemType | The itemtypes to choose for being cooldown. |
SetCustomRoleFriendlyFire(String, RoleTypeId, Single)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public void SetCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, float ffMult)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleTypeId | Role associated for CustomFF. |
| PlayerRoles.RoleTypeId | roleToAdd | Role to add. |
| System.Single | ffMult | Friendly fire multiplier. |
SetCustomRoleFriendlyFire(String, KeyValuePair<RoleTypeId, Single>)
Wrapper to call SetCustomRoleFriendlyFire(String, RoleTypeId, Single).
Declaration
public void SetCustomRoleFriendlyFire(string roleTypeId, KeyValuePair<RoleTypeId, float> roleFf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleTypeId | Role associated for CustomFF. |
| System.Collections.Generic.KeyValuePair<PlayerRoles.RoleTypeId, System.Single> | roleFf | Role with FF to add even if it exists. |
SetFriendlyFire(RoleTypeId, Single)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public void SetFriendlyFire(RoleTypeId roleToAdd, float ffMult)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.RoleTypeId | roleToAdd | Role to add. |
| System.Single | ffMult | Friendly fire multiplier. |
SetFriendlyFire(KeyValuePair<RoleTypeId, Single>)
Wrapper to call SetFriendlyFire(RoleTypeId, Single).
Declaration
public void SetFriendlyFire(KeyValuePair<RoleTypeId, float> roleFF)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.KeyValuePair<PlayerRoles.RoleTypeId, System.Single> | roleFF | Role with FF to add even if it exists. |
SetRank(String, UserGroup)
Sets the player's rank.
Declaration
public void SetRank(string name, UserGroup group)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The rank name to be set. |
| UserGroup | group | The group to be set. |
ShowHint(Hint)
Show a hint to the player.
Declaration
public void ShowHint(Hint hint)
Parameters
| Type | Name | Description |
|---|---|---|
| Hint | hint | The hint to be shown. |
ShowHint(String, Single)
Shows a hint to the player.
Declaration
public void ShowHint(string message, float duration = 3F)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | The message to be shown. |
| System.Single | duration | The duration the text will be on screen. |
ShowHitMarker(Single)
Sends a HitMarker to the player.
Declaration
public void ShowHitMarker(float size = 1F)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | size | The size of the hitmarker, ranging from |
SyncEffect(Effect)
Syncs the status effect on the player.
Declaration
public void SyncEffect(Effect effect)
Parameters
| Type | Name | Description |
|---|---|---|
| Effect | effect | The Effect to sync. |
SyncEffects(IEnumerable<Effect>)
Syncs a System.Collections.Generic.IEnumerable<T> of Effect on the player.
Declaration
public void SyncEffects(IEnumerable<Effect> effects)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Effect> | effects | The System.Collections.Generic.IEnumerable<T> of Effect to enable. |
Teleport(Object)
Teleports the player to the given object, with no offset.
Declaration
public void Teleport(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The object to teleport to. |
Teleport(Object, Vector3)
Teleports the player to the given object, offset by the defined offset value.
Declaration
public void Teleport(object obj, Vector3 offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The object to teleport the player to. |
| UnityEngine.Vector3 | offset | The offset to teleport. |
Teleport(Vector3)
Teleports the player to the given UnityEngine.Vector3 coordinates.
Declaration
public void Teleport(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | position | The UnityEngine.Vector3 coordinates to move the player to. |
ThrowGrenade(ProjectileType, Boolean)
Forces the player to throw a grenade.
Declaration
public Throwable ThrowGrenade(ProjectileType type, bool fullForce = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | type | The ProjectileType to be thrown. |
| System.Boolean | fullForce | Whether to throw with full or half force. |
Returns
| Type | Description |
|---|---|
| Throwable | The Throwable item that was spawned. |
ThrowItem(Throwable, Boolean)
Forcefully throws a throwable item.
Declaration
public void ThrowItem(Throwable throwable, bool fullForce = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Throwable | throwable | The Throwable to be thrown. |
| System.Boolean | fullForce | Whether to throw with full or half force. |
ToString()
Converts the player in a human-readable format.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string containing Player-related data. |
Overrides
TryAddCandy(CandyKindID)
Gives the player a specific candy. Will give the player a bag if they do not already have one.
Declaration
public bool TryAddCandy(CandyKindID candyType)
Parameters
| Type | Name | Description |
|---|---|---|
| InventorySystem.Items.Usables.Scp330.CandyKindID | candyType | The InventorySystem.Items.Usables.Scp330.CandyKindID to give. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if a candy was given. |
TryAddCustomRoleFriendlyFire(Dictionary<String, Dictionary<RoleTypeId, Single>>)
Adds the Custom role to the CustomRoleFriendlyFireMultiplier if they did not already exist.
Declaration
public void TryAddCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>> customRoleFriendlyFireMultiplier)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single>> | customRoleFriendlyFireMultiplier | Custom role with FF role rules. |
TryAddCustomRoleFriendlyFire(String, RoleTypeId, Single)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules for CustomRole.
Declaration
public bool TryAddCustomRoleFriendlyFire(string roleTypeId, RoleTypeId roleToAdd, float ffMult)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleTypeId | Role associated for CustomFF. |
| PlayerRoles.RoleTypeId | roleToAdd | Role to add. |
| System.Single | ffMult | Friendly fire multiplier. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryAddCustomRoleFriendlyFire(String, Dictionary<RoleTypeId, Single>, Boolean)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public bool TryAddCustomRoleFriendlyFire(string customRoleName, Dictionary<RoleTypeId, float> ffRules, bool overwrite = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | customRoleName | Role associated for CustomFF. |
| System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single> | ffRules | Roles to add with friendly fire values. |
| System.Boolean | overwrite | Whether to overwrite current values if they exist - does NOT delete previous entries if they are not in provided rules. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryAddCustomRoleFriendlyFire(String, KeyValuePair<RoleTypeId, Single>)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules for CustomRole.
Declaration
public bool TryAddCustomRoleFriendlyFire(string roleTypeId, KeyValuePair<RoleTypeId, float> roleFf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleTypeId | Role associated for CustomFF. |
| System.Collections.Generic.KeyValuePair<PlayerRoles.RoleTypeId, System.Single> | roleFf | Role to add and FF multiplier. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryAddFriendlyFire(RoleTypeId, Single)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public bool TryAddFriendlyFire(RoleTypeId roleToAdd, float ffMult)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.RoleTypeId | roleToAdd | Role to add. |
| System.Single | ffMult | Friendly fire multiplier. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryAddFriendlyFire(Dictionary<RoleTypeId, Single>, Boolean)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public bool TryAddFriendlyFire(Dictionary<RoleTypeId, float> ffRules, bool overwrite = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single> | ffRules | Roles to add with friendly fire values. |
| System.Boolean | overwrite | Whether or not to overwrite current values if they exist. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryAddFriendlyFire(KeyValuePair<RoleTypeId, Single>)
Tries to add PlayerRoles.RoleTypeId to FriendlyFire rules.
Declaration
public bool TryAddFriendlyFire(KeyValuePair<RoleTypeId, float> pairedRoleFF)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.KeyValuePair<PlayerRoles.RoleTypeId, System.Single> | pairedRoleFF | Role FF multiplier to add. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryGet(CommandSender, out Player)
Try-get a player given a CommandSender.
Declaration
public static bool TryGet(CommandSender sender, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandSender | sender | The CommandSender. |
| Player | player | The player that matches the given CommandSender, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(ICommandSender, out Player)
Try-get a player given a CommandSystem.ICommandSender.
Declaration
public static bool TryGet(ICommandSender sender, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandSystem.ICommandSender | sender | The CommandSystem.ICommandSender. |
| Player | player | The player that matches the given CommandSystem.ICommandSender, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(Footprint, out Player)
Try-get a player given a Footprinting.Footprint.
Declaration
public static bool TryGet(Footprint footprint, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| Footprinting.Footprint | footprint | The Footprinting.Footprint. |
| Player | player | The player that matches the given Footprinting.Footprint, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(NetworkConnection, out Player)
Try-get a player given a Mirror.NetworkConnection.
Declaration
public static bool TryGet(NetworkConnection conn, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| Mirror.NetworkConnection | conn | The Mirror.NetworkConnection. |
| Player | player | The player that matches the given Mirror.NetworkConnection, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(NetworkIdentity, out Player)
Try-get a player given a Mirror.NetworkIdentity.
Declaration
public static bool TryGet(NetworkIdentity netIdentity, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| Mirror.NetworkIdentity | netIdentity | The Mirror.NetworkIdentity. |
| Player | player | The player that matches the given Mirror.NetworkIdentity, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(Player, out Player)
Try-get the Player from NwPluginAPI class.
Declaration
public static bool TryGet(Player apiPlayer, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| PluginAPI.Core.Player | apiPlayer | The PluginAPI.Core.Player class. |
| Player | player | The player found or null if not found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(ReferenceHub, out Player)
Try-get a player given a ReferenceHub.
Declaration
public static bool TryGet(ReferenceHub referenceHub, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| ReferenceHub | referenceHub | The ReferenceHub. |
| Player | player | The player that matches the given ReferenceHub, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(Int32, out Player)
Try-get a player given an ID.
Declaration
public static bool TryGet(int id, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The user ID. |
| Player | player | The player that matches the given ID, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(String, out Player)
Try-get a player by identifier.
Declaration
public static bool TryGet(string args, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | args | The player's nickname, ID, steamID64 or Discord ID. |
| Player | player | The player found or null if not found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(UInt32, out Player)
Try-get a player given a network ID.
Declaration
public static bool TryGet(uint netId, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | netId | The network ID. |
| Player | player | The player that matches the given net ID, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(Collider, out Player)
Try-get player by UnityEngine.Collider.
Declaration
public static bool TryGet(Collider collider, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Collider | collider | The UnityEngine.Collider. |
| Player | player | The player found or null if not found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGet(GameObject, out Player)
Try-get a player given a UnityEngine.GameObject.
Declaration
public static bool TryGet(GameObject gameObject, out Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.GameObject | gameObject | The UnityEngine.GameObject. |
| Player | player | The player that matches the given UnityEngine.GameObject, or null if no player is found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A boolean indicating whether or not a player was found. |
TryGetComponent(Type, out EActor)
Declaration
public bool TryGetComponent(Type type, out EActor component)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| EActor | component |
Returns
| Type | Description |
|---|---|
| System.Boolean |
TryGetComponent<T>(out T)
Declaration
public bool TryGetComponent<T>(out T component)
where T : EActor
Parameters
| Type | Name | Description |
|---|---|---|
| T | component |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Type Parameters
| Name | Description |
|---|---|
| T |
TryGetComponent<T>(Type, out T)
Declaration
public bool TryGetComponent<T>(Type type, out T component)
where T : EActor
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | |
| T | component |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Type Parameters
| Name | Description |
|---|---|
| T |
TryGetEffect(EffectType, out StatusEffectBase)
Tries to get an instance of CustomPlayerEffects.StatusEffectBase by EffectType.
Declaration
public bool TryGetEffect(EffectType type, out StatusEffectBase statusEffect)
Parameters
| Type | Name | Description |
|---|---|---|
| EffectType | type | The EffectType. |
| CustomPlayerEffects.StatusEffectBase | statusEffect | The CustomPlayerEffects.StatusEffectBase. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the |
TryGetEffect<T>(out T)
Tries to get an instance of CustomPlayerEffects.StatusEffectBase by EffectType.
Declaration
public bool TryGetEffect<T>(out T statusEffect)
where T : StatusEffectBase
Parameters
| Type | Name | Description |
|---|---|---|
| T | statusEffect | The CustomPlayerEffects.StatusEffectBase. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A bool indicating whether or not the |
Type Parameters
| Name | Description |
|---|---|
| T | The CustomPlayerEffects.StatusEffectBase to get. |
TryGetItem(UInt16, out Item)
Tries to get an item from a player's inventory.
Declaration
public bool TryGetItem(ushort serial, out Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | serial | The unique identifier of the item. |
| Item | item | The Item found. null if it doesn't exist. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the item is found, false otherwise. |
TryGetSessionVariable<T>(String, out T)
Safely gets an System.Object from SessionVariables, then casts it to T.
Declaration
public bool TryGetSessionVariable<T>(string key, out T result)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key of the object to get. |
| T | result | 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
| Type | Description |
|---|---|
| System.Boolean | true if the SessionVariables contains an element with the specified key; otherwise, false. |
Type Parameters
| Name | Description |
|---|---|
| T | The returned object type. |
TryRemoveCustomeRoleFriendlyFire(String)
Tries to remove PlayerRoles.RoleTypeId from FriendlyFire rules.
Declaration
public bool TryRemoveCustomeRoleFriendlyFire(string role)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | role | Role to add. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TryRemoveFriendlyFire(RoleTypeId)
Tries to remove PlayerRoles.RoleTypeId from FriendlyFire rules.
Declaration
public bool TryRemoveFriendlyFire(RoleTypeId role)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerRoles.RoleTypeId | role | Role to add. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether or not the item was able to be added. |
TrySetCustomRoleFriendlyFire(Dictionary<String, Dictionary<RoleTypeId, Single>>)
Sets the CustomRoleFriendlyFireMultiplier.
Declaration
public void TrySetCustomRoleFriendlyFire(Dictionary<string, Dictionary<RoleTypeId, float>> customRoleFriendlyFireMultiplier)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single>> | customRoleFriendlyFireMultiplier | New rules for CustomeRoleFriendlyFireMultiplier to set to. |
TrySetCustomRoleFriendlyFire(String, Dictionary<RoleTypeId, Single>)
Sets the CustomRoleFriendlyFireMultiplier.
Declaration
public void TrySetCustomRoleFriendlyFire(string roleTypeId, Dictionary<RoleTypeId, float> customRoleFriendlyFireMultiplier)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | roleTypeId | Role to associate FF rules to. |
| System.Collections.Generic.Dictionary<PlayerRoles.RoleTypeId, System.Single> | customRoleFriendlyFireMultiplier | New rules for CustomeRoleFriendlyFireMultiplier to set to. |
UnMute(Boolean)
Revokes a persistent mute. For temporary mutes, see IsMuted and IsIntercomMuted.
Declaration
public void UnMute(bool isIntercom = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isIntercom | Whether or not this un-mute is for the intercom only. |
UseItem(Item)
Forces the player to use an item.
Declaration
public bool UseItem(Item item)
Parameters
| Type | Name | Description |
|---|---|---|
| Item | item | The item to be used. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if item was used successfully. Otherwise, false. |
UseItem(ItemType)
Forces the player to use an item.
Declaration
public bool UseItem(ItemType usableItem)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | usableItem | The ItemType to be used. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if item was used successfully. Otherwise, false. |
Vaporize(Player, String)
Kills the player and vaporizes the body.
Declaration
public void Vaporize(Player attacker = null, string cassieAnnouncement = "")
Parameters
| Type | Name | Description |
|---|---|---|
| Player | attacker | The Player attacking player. |
| System.String | cassieAnnouncement | The cassie announcement to make upon death. |
Operators
| Improve this Doc View SourceImplicit(Player to Player)
Converts NwPluginAPI player to EXILED player.
Declaration
public static implicit operator Player(Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| PluginAPI.Core.Player | player | The NwPluginAPI player. |
Returns
| Type | Description |
|---|---|
| Player | EXILED player. |