Methods available when called from a Player object (within the defined realm)
Sets up role logic for the player to handle role-specific events and checks.
Realm: Server
Added in: 1.1.9
Plays a celebration effect (sound and or confetti) at the player's location.
Realm: Client
Added in: 1.3.1
Parameters:
Whether the player can loot credits from a corpse that has them.
Realm: Client and Server
Added in: 1.0.5
Parameters:
false
)
Whether the player can see the C4 icons like traitors can.
Realm: Client and Server
Added in: 1.5.14
Whether the player can currently open the shop menu.
Realm: Client and Server
Added in: 1.0.2
Whether the player can see and use traitor buttons.
Realm: Client and Server
Added in: 1.0.5
Parameters:
false
)
Clears the player's forced role if one was set with plymeta:ForceRoleNextRound(role)
.
Realm: Server
Added in: 2.0.7
Clears the value of the property with the given name
on this player and then synchronizes that value to all targets
. Wrapper around SYNC:ClearPlayerProperty.
Realm: Server
Added in: 2.1.18
Parameters:
Removes queued messages with the given ID from the queue and clears any currently displayed messages with the given ID.
Realm: Client and Server
Added in: 2.2.1
Parameters:
Creates an invisible entity that follows this dead player. Useful for tracking their position as a spectator more accurately due to the low network rate for spectator players.
Realm: Server
Added in: 2.3.2
Parameters:
false
) (Added in 2.3.3)
Disables this player's role ability, if it isn't already.
NOTE: If the player's role ability was not already disabled, this will also call the TTTOnRoleAbilityDisabled
hook
Realm: Client and Server
Added in: 2.2.9
Blocks player's purchases from the equipment shop, if they weren't already.
NOTE: If the player's purchases were not already blocked, this will also call the TTTOnShopPurchaseDisabled
hook
Realm: Server
Added in: 2.2.9
Attempts to find the losing team and calls self:SoberDrunk(team)
using the losing team as the team parameter.
Realm: Server
Added in: 1.7.2
Sets the Drunk's role and runs required checks for that role.
Realm: Server
Added in: 1.1.9
Parameters:
Enables this player's role ability, if it was previously disabled.
NOTE: If the player's role ability was previously disabled, this will also call the TTTOnRoleAbilityEnabled
hook
Realm: Client and Server
Added in: 2.2.9
Enables player's ability to purchase from the equipment shop, if it was previously disabled.
NOTE: If the player's shop purchases were previously disabled, this will also call the TTTOnShopPurchaseEnabled
hook.
Realm: Server
Added in: 2.2.9
Forces a player to spawn as the specified role next round. Returns true
if successful, false
if that player has already been forced to be another role.
Realm: Server
Added in: 2.0.7
Parameters:
Whether this player wants to avoid being a detective role.
Realm: Server
Added in: 1.0.0
Whether this player wants to bypass map optimizations like vis leafs and culling for things like role head icons and highlighting.
Realm: Server
Added in: 1.6.2
Gets the role that should be displayed for the player.
Realm: Client and Server
Added in: 1.5.3
Returns:
Gets the player's forced role if one was set with plymeta:ForceRoleNextRound(role)
. Returns false
otherwise.
Realm: Server
Added in: 2.0.7
Gets the estimated height of the player based on their player model.
Realm: Client
Added in: 1.0.2
Gets which "role team" a player belongs to (see ROLE_TEAM_* global enumeration).
Realm: Client and Server
Added in: 1.2.7
Parameters:
Gets whether the player is currently sprinting.
Realm: Client and Server
Added in: 1.8.8
Gets the player's current sprint stamina.
Realm: Client and Server
Added in: 1.8.8
Gets the player's previous role if they are a Vampire that has been converted or ROLE_NONE
otherwise.
Realm: Client and Server
Added in: 1.0.0
Give the player their shop items that were being held due to the role having a delayed shop.
Realm: Server
Added in: 1.2.2
Handles the player's promotion as a detective-like role (deputy/Impersonator). Promotes the player and sends necessary net events.
Realm: Server
Added in: 1.2.5
Dynamically created functions for each role that returns whether the player is that role. For example: plymeta:IsTraitor()
and plymeta:IsPhantom()
return whether the player is a Traitor or a Phantom, respectively.
Realm: Client and Server
Added in: Whenever each role is added
Dynamically created functions for each role that returns whether plymeta:Is{RoleName}
returns true
and the player is active. For example: plymeta:IsActiveTraitor()
and plymeta:IsActivePhantom()
return whether the player is active and a Traitor or a Phantom, respectively.
Realm: Client and Server
Added in: Whenever each role is added
Whether plymeta:IsCustom
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsDetectiveLike
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsDetectiveTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsIndependentTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsInnocentTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsJesterTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsMonsterTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsTraitorTeam
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether plymeta:IsActiveShopRole
returns true
and the player is active.
Realm: Client and Server
Added in: 1.0.0
Whether the player's role is not one of the three regular TTT roles.
Realm: Client and Server
Added in: 1.0.0
Whether the player's role is like a detective (e.g. detective or promoted Deputy/Impersonator).
Realm: Client and Server
Added in: 1.0.0
Whether the player is a detective role (e.g. detective or special detective).
Realm: Client and Server
Added in: 1.0.0
Whether the player's role is an unpromoted detective-like role (deputy/Impersonator).
Realm: Client and Server
Added in: 1.2.5
Whether the player is on the independent team.
Realm: Client and Server
Added in: 1.0.0
Whether the player is on the innocent team.
Realm: Client and Server
Added in: 1.0.0
Whether the player is invulnerable.\
Realm: Client and Server
Added in: 2.1.17
Whether the player is on the jester team.
Realm: Client and Server
Added in: 1.0.0
Whether the player is on the monster team.
Realm: Client and Server
Added in: 1.0.0
Whether the entity or position given is on screen for the player, within the given value limit.
Realm: Client and Server
Added in: 1.6.2
Parameters:
Whether this player has been ragdolled by plymeta:Ragdoll
.
Realm: Client and Server
Added in: 2.3.2
Whether this player is currently respawning.
Realm: Client and Server
Added in: 2.1.12
Called to check whether a player's role ability is disabled.
NOTE: Calls TTTIsRoleAbilityDisabled
hook to determine status if plymeta:DisableRoleAbility
has not previously been called.
NOTE: Calls plymeta:DisableRoleAbility
if TTTIsRoleAbilityDisabled
is called and result is true
.
Realm: Client and Server
Added in: 2.2.9
Parameters:
TTTIsRoleAbilityDisabled
hook and plymeta:DisableRoleAbility
method
Returns: true
if the player's role ability is currently disabled, false
otherwise.
Whether the player's role feature has been activated.
Realm: Client and Server
Added in: 1.2.2
Whether the player is on the same team as the target.
Realm: Client and Server
Added in: 1.0.0
Parameters:
Whether the player is currently overriding a piece of scoreboard information.
Realm: Client
Added in: 1.5.15
Parameters:
Returns:
Called to check whether a player's shop purchases are disabled.
NOTE: Calls TTTIsShopPurchaseDisabled
hook to determine status if plymeta:DisableShopPurchases
has not previously been called.
NOTE: Calls plymeta:DisableShopPurchases
if TTTIsShopPurchaseDisabled
hook is called and result is true
.
Realm: Client and Server
Added in: 2.2.9
Parameters:
TTTIsShopPurchaseDisabled
hook and plymeta:DisableShopPurchases
method
Returns: true
if the player's shop purchases are currently disabled, false
otherwise.
Whether the player has a shop (see plymeta:CanUseShop
for determining if it is openable).
Realm: Client and Server
Added in: 1.0.0
Whether the target player is highlighted based the player's role rules.
Realm: Client
Added in: 1.5.15
Parameters:
Whether the player is currently overriding a piece of target ID information.
Realm: Client
Added in: 1.5.15
Parameters:
Returns:
Whether the player is on the traitor team.
Realm: Client and Server
Added in: 1.0.0
Whether the player is allied with the Vampire role.
Realm: Client and Server
Added in: 1.0.0
Whether the player is the prime (e.g. first-spawned) Vampire.
Realm: Client and Server
Added in: 1.0.0
Whether victims killed by this player are changing their role.
Realm: Client and Server
Added in: 1.9.12
Parameters:
Whether the player is allied with the Zombie role.
Realm: Client and Server
Added in: 1.0.0
Whether the player is the prime (e.g. first-spawned) Zombie.
Realm: Client and Server
Added in: 1.0.0
Whether the player is in the process of respawning as a Zombie.
Realm: Client and Server
Added in: 1.5.12
Moves role state data (such as promotion and monster prime status) to the target.
Realm: Client and Server
Added in: 1.0.5
Parameters:
false
)
Begins printing messages from the message queue if it's not already. Automatically called by plymeta:QueueMessage
.
Realm: Server
Added in: 1.9.4
Queues a message to be shown to the player. Useful in situations where multiple center-screen messages could be shown at the same time and overlapped. This ensures each message is shown in order without overlap.
Realm: Server and Client
Added in: 1.9.4
Parameters:
message_type
is MSG_PRINTBOTH
or MSG_PRINTCENTER
(Optional. Defaults to 5 seconds if not provided)true
to allow the message or false
to prevent it (Optional) (Added in 2.0.5) (Only available on the server realm)
Creates a ragdoll representation of this player and forces the player to spectate it.
Realm: Server
Added in: 2.3.2
Parameters:
Returns: The created ragdoll entity.
Removes the equipment item with given ID from this player.
Realm: Server
Added in: 2.1.1
Parameters:
Removes the invisible following entity for this player.
Realm: Server
Added in: 2.3.2
Clears the message queue for the player.
Realm: Server
Added in: 1.9.4
Reset's the players size to default by adjusting models, step sizes, hulls and view offsets.
Realm: Server
Added in: 1.3.1
Respawns the player as a Zombie after a 3 second delay.
Realm: Server
Added in: 1.5.12
Parameters:
Sets the credits on the player based on their role's starting credits convars.
Realm: Server
Added in: 1.0.0
Parameters:
false
) (Added in 1.6.2)
Controls if the player should be invulnerable or not.\
Realm: Server
Added in: 2.1.17
Parameters:
true
to enable invulnerability, false
to disable
Sets the player's size by adjusting models, step sizes, hulls and view offsets.
Realm: Server
Added in: 1.3.1
Parameters:
Sets the value of the property with the given name
on this player to equal value
and then synchronizes that value to all targets
. Wrapper around SYNC:SetPlayerProperty.
Realm: Server
Added in: 2.1.18
Parameters:
Sets the player's role to the given one and (if called on the server) broadcasts the change to all clients for scoreboard tracking.
Realm: Client and Server
Added in: 1.0.0
Parameters:
Sets whether the player is currently sprinting.
Realm: Client and Server
Added in: 1.8.8
Parameters:
Sets the player's current sprint stamina.
Realm: Client and Server
Added in: 1.8.8
Parameters:
Sets the player's previous role for when they are turned into a Vampire.
Realm: Server
Added in: 1.0.0
Parameters:
Sets whether the player is a prime (e.g. first-spawned) Vampire.
Realm: Server
Added in: 1.0.0
Parameters:
Sets whether the player is a prime (e.g. first-spawned) Zombie.
Realm: Server
Added in: 1.0.0
Parameters:
Whether the player should act like a jester (e.g. in what damage they do, what damage they take, how they appear to other players, etc.).
Realm: Client and Server
Added in: 1.2.5
Whether the player's shop purchase deliveries should be delayed.
Realm: Client and Server
Added in: 1.2.2
Whether the player should hide a jester player's role (in radar, on the scoreboard, in target ID, etc.).
Realm: Client and Server
Added in: 1.2.5
Whether the player should not show the drown effect or take drowning damage.
Realm: Client and Server
Added in: 1.5.7
Whether the player should reveal the fact that the target player is no longer a Beggar (e.g. converted to an Innocent or Traitor).
Realm: Client and Server
Added in: 1.2.5
Parameters:
ply:ShouldRevealBeggar()
is the same as ply:ShouldRevealBeggar(ply)
)
Whether the player should reveal the fact that the target player is no longer a Bodysnatcher (e.g. has snatched a role from a dead body).
Realm: Client and Server
Added in: 1.2.5
Parameters:
ply:ShouldRevealBodysnatcher()
is the same as ply:ShouldRevealBodysnatcher(ply)
)
Whether this player should have their role revealed (over their head, on the scoreboard, etc.) when their role is active.
Realm: Client and Server
Added in: 1.9.9
Whether this player should currently be shown a spectator HUD. Used for things like the Phantom and Parasite spectator HUDs.
Realm: Client and Server
Added in: 1.3.1
Runs the logic for when a Drunk sobers up and remembers their role.
Realm: Server
Added in: 1.1.9
Parameters:
Stops the player from respawning due to a role feature.
Realm: Server
Added in: 2.1.12
Returns: true
if a respawn was stopped, false
otherwise.
Strips all weapons from the player whose Category
property matches the global WEAPON_CATEGORY_ROLE
value.
Realm: Client and Server
Added in: 1.0.5
Removes the ragdoll representation of this player created by plymeta:Ragdoll
and restores the player state.
Realm: Server
Added in: 2.3.2