Player
Player Metatable Extensions
Functions
Player:Blind(boolean)
View source »Function to (un)blindfold a player.
Parameters
-
boolean
bool
default: false
If the blindfold should be applied or not.
Player:CanAfford(amount)
View source »Check if a player can afford an amount of money.
Parameters
-
amount
Returns
-
bool
Player:CustomPass()
View source »Check a player's custom pass title.
Returns
-
optional string
The custom pass title or nil if none.
Player:Demote()
View source »Demote a player from their current team.
Entity:DistToSqr(other)
View source »Get the squared distance between this entity, and another vector or entity.
Parameters
Entity:Distance(other)
View source »Get the distance between this entity, and another vector or entity.
Parameters
Player:DoorAccess(door)
View source »Check if a player has access to a door.
Parameters
-
door
Entity
Returns
-
bool
Player:GenderWord()
This function is deprecated and may be removed in a future version.
Get the possessive pronoun for this player.
Returns
Player:GenderWord2()
This function is deprecated and may be removed in a future version.
Get the pronoun for this player.
Returns
Player:GetAssociate()
View source »Check if a player has is a group associate.
Returns
-
optional string
Pass name
Player:GetCanIC()
View source »Check if a player can speak in IC chats.
Returns
-
bool
Player:GetCanLOOC()
View source »Check if a player can speak in LOOC.
Returns
-
bool
Player:GetDefaultPropLimit()
View source »Get a user's default proplimit. This takes into account rank.
Player:GetFakeSteamName()
View source »Gets a player's fake steam name.
Returns
Player:GetGender()
View source »Get a players gender.
Returns
-
string
The player's gender, one of the GENDER_ enums.
Player:GetGenderAdjectivePronoun()
View source »Get the gendered adjective pronoun for the player.
Returns
Player:GetGenderDemonstrativePronoun()
View source »Get the gendered demonstrative pronoun for the player.
Returns
Player:GetGenderPosessessivePronoun()
View source »Get the gendered posessive pronoun for the player.
Returns
Player:GetGenderPronoun()
View source »Get the gendered pronoun for the player.
Returns
Player:GetGenderReflexivePronoun()
View source »Get the gendered reflexive pronoun for the player.
Returns
Player:GetGenderTitle()
View source »Get the title of the gender for the player.
Returns
Player:GetLastDeath()
View source »Gets a player's last death timestamp.
Returns
Player:GetLastDeathLoc()
View source »Gets a player's last death location name.
Returns
Player:GetLastDeathPos()
View source »Gets a player's last death position.
Returns
Player:GetLocalNetVar(string, any)
View source »Get a local player variable, which is only networked to the player it is initially set on.
Parameters
-
string
key The key of the variable
-
any
default The default value of the variable
Returns
-
any
any The value of the variable
Player:GetNSVar(key, default)
This function is deprecated and may be removed in a future version.
Get a network variable on a player
Parameters
-
key
-
default
See Also
Entity:GetNetVar(string, any)
View source »Get a variable on this entity
Parameters
-
string
key The key of the variable
-
any
default The default value of the variable
Returns
-
any
any The value of the variable
Player:GetOOCMessageCount()
View source »Gets the number of OOC messages a player has recently sent.
Returns
-
int
Player:GetOverridePropLimit()
View source »Get a user's overridden proplimit. This can only be set by command.
Player:GetPass()
View source »Get a player's pass.
Returns
-
optional string
Pass name
Player:GetPlayerModel()
This function is deprecated and may be removed in a future version.
Get a players model.
Returns
Player:GetPlayerName()
This function is deprecated and may be removed in a future version.
Get a players name
Returns
Player:GetPoliceRank()
View source »Get a player's police rank.
Returns
-
int
Player:GetPoliceRankString()
This function is deprecated and may be removed in a future version.
This function is only used for the #rank /teamname replacement, and %rank chat wildcard.
Get a player's "police rank".
Returns
-
string
Rank name.
Player:GetPropLimit()
View source »Get a user's real proplimit. This is a combination of the above two.
Player:GetPursuitPlate()
View source »Gets a player's last scanned license plate.
Returns
Player:GetPursuitVehicle()
View source »Gets a player's last scanned vehicle name.
Returns
Player:GetRankColor()
View source »Get a player's rank color.
Player:GetRankData()
View source »Gets rank data for a player.
Returns
-
optional table
Player:GetRankDisplayOrder()
View source »Get a ranks display order.
Returns
-
int
Player:GetRankIcon()
View source »Get a rank's rank icon.
Player:GetRankIconMaterial()
View source »Get a precached rank icon material.
Returns
-
IMaterial
Player:GetRankIconString()
View source »Get the string representation of a rank icon.
Returns
Player:GetRankName()
View source »Get a player's rank name.
Returns
-
string
Rank name or "User"
Player:GetRankPhysgunColor()
View source »Get a rank's physgun color.
Player:GetSVRank()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
This function is deprecated and may be removed in a future version.
Get the player's rank.
Returns
-
string
Rank string.
See Also
Player:GetScanTime()
View source »Gets a player's last scanned vehicle timestamp.
Returns
Player:GetUserGroup()
View source »Get the player's rank.
Returns
-
string
Rank string.
Player:GiveMoney(value, reason)
View source »Give a player an amount of money.
Parameters
-
value
int
default: 0
Money to give.
-
reason
string
default: ""
Reason for money being given.
Player:HasAdminHelpEnabled()
View source »Check if a player has admin help enabled.
Returns
-
bool
Admin Help Status
Player:HasAdminHelpNLRToggled()
View source »Check if a player's NLR helper is enabled.
Returns
-
bool
NLR helper.
Player:HasAdminHelpToggled()
View source »Check if the player's admin help is toggled.
Returns
-
bool
Player:HasPackage(id)
View source »Check if a player has a given package.
Parameters
-
id
string or int
Package ID.
Returns
-
bool
Player:HasRPPoints(count)
View source »Check if a player has a given number of RP Points.
Parameters
-
count
int
Returns
-
bool
Player:HasTags()
View source »Check if a player has tags which match with their rank.
Returns
-
bool
If the player is currently wearing appopriate tags.
Player:HasVeteran()
View source »Checks if the plaer has active veteran benefits. This can be from either having the veteran rank OR being a non-user, who has a VeteranType. Anyone who is a user with a veteran type has had their veteran revoked, so they can be ignored.
Returns
-
bool
If the player has active veteran benefits.
Player:InElectricVehicle()
This function is deprecated and may be removed in a future version.
Check if a player is in an electric vehicle.
Returns
-
bool
Player:IsAFK()
View source »Check if a player is afk.
Returns
-
bool
Player:IsAdmin()
View source »Check if the player holds admin permissions.
Returns
-
bool
Player:IsContributor()
View source »Gets if a player is a contributor.
Returns
-
bool
Player:IsContributorOrAdmin()
This function is deprecated and may be removed in a future version.
This should be two checks.
Get if the player is a contributor+ or an administrator.
Returns
-
bool
See Also
Player:IsDeveloper()
View source »Check if the player is a developer.
Returns
-
bool
Player:IsDeveloperAdmin()
View source »Check if the player holds developer & admin permissions
Returns
-
bool
Player:IsDeveloperOnly()
View source »Once again, this is used in a LOT of places.
Returns
-
bool
See Also
Player:IsDeveloperOrAdmin()
This function is deprecated and may be removed in a future version.
This should be two checks.
Get if the player is a developer+ or an administrator.
Returns
-
bool
See Also
Player:IsDeveloperTrialAdmin()
View source »Check if the player has developer & trial admin permissions.
Returns
-
bool
Player:IsDonator()
This function is deprecated and may be removed in a future version.
Use IsSupporter or IsSupporterPlus
Gets if a player is a donator.
See Also
Player:IsERU()
View source »Check if a player is a ERU member.
Returns
-
bool
Player:IsEventCoordinator()
View source »Check if the player is an event coordonator.
Returns
-
bool
Player:IsEventManager()
View source »Check if the player is an event manager.
Returns
-
bool
Player:IsFLTeamMember()
View source »Get if the player is a team member.
Returns
-
bool
Player:IsFemale()
View source »Check if a player is female
Returns
-
any
bool Is the player female
Player:IsGovernment()
View source »Check if a player is a member of the government.
Returns
-
bool
Player:IsHidden()
View source »Check if a player is hidden.
Returns
-
bool
Player:IsHidingRank()
View source »Check if a player's rank is hidden from their lack of tags.
Returns
-
bool
Player:IsLawEnforcement()
View source »Check if a player is a member of law enforcement.
Returns
-
bool
Player:IsMafia()
View source »Check if a player is a corelone.
Returns
-
bool
Player:IsMod()
View source »Check if the player has moderator powers. Currently this just checks for Trial Admin, but this function is used in >50 places in the GM.
Returns
-
bool
See Also
Player:IsModerator()
View source »Check if the player has moderator powers. Currently this just checks for Trial Admin, but this function is used in >100 places in the GM.
Returns
-
bool
See Also
Player:IsOutside()
View source »Check if a player is outside.
Returns
-
bool
Player:IsOwner()
View source »Check if the player holds the owner permissions.
Returns
-
bool
Player:IsPolice()
View source »Check if a player is a police officer.
Returns
-
bool
Player:IsPresident()
View source »Check if a player is a president.
Returns
-
bool
Player:IsPresidentialAdministration()
View source »Check if the player is a member of the Presidential Administration. Members of this class are able to do administrative duties, such as issuing passes.
Returns
-
bool
Player:IsQuizEntered()
View source »Gets if a player is in a quiz.
Returns
Player:IsRank(rank)
This function is deprecated and may be removed in a future version.
Check if the player is a given rank.
Parameters
-
rank
string
Returns
-
bool
See Also
Player:IsRebel()
View source »Check if a player is a rebel.
Returns
-
bool
Player:IsSWAT()
View source »Check if a player is a swat officer.
Returns
-
bool
Player:IsSpectator()
View source »Check if a player is a spectator.
Returns
-
bool
Player:IsSuperAdmin()
View source »Check if the player holds super admin permissions.
Returns
-
bool
Player:IsSuperDeveloper()
View source »Check if the player holds super developer permissions.
Returns
-
bool
Player:IsSupporter()
View source »Check if a player has the supporter package.
Returns
-
bool
Player:IsSupporterPlus()
View source »Check if a player has the supporter+ package.
Returns
-
bool
Player:IsTeamGroup(group, Should)
View source »Check if a player is in a given team group.
Parameters
-
group
Group to check against (one of teamgroups key or team index).
-
Should
bool
default: false
members of the same team be included, even if not in the same team-group.
Returns
-
bool
Player:IsTrialAdmin()
View source »Check if a player has trial admin permissions.
Returns
-
bool
Player:IsTrialAdminOnly()
View source »Check if the player is exclusively a trial admin (not including inheritance).
Returns
-
bool
Player:IsUserGroup(rank)
View source »Check if the player is a given rank.
Parameters
-
rank
string
Returns
-
bool
If the player is the rank.
Player:IsVeteran()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
This function only checks a player's rank, not their actual veteran status.
Checks if the player has the veteran rank.
Returns
-
bool
See Also
Player:Name(replace)
View source »Get a player's name, or attempt to find their undercover name.
Parameters
-
replace
bool
Whether we should attempt to use a player's 'real' name, if they're undercover.
Returns
-
string
Steam Name, Faked Steam Name or Administrative Name.
Player:Nick()
View source »Get a player's (possibly faked) steam name.
Returns
-
string
Steam Name or Admin Faked Steam Name.
See Also
Player:NickOrig()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Get a player's steam name
Returns
-
string
Steam Name
See Also
Player:NotifyCooldown(message, class, cooldown)
View source »Notify a player of message, but with a cooldown Useful for hooks which are called on repeat, such as PlayerUse.
Parameters
-
message
string
Message to send
-
class
int
optional
Message class to send.
-
cooldown
int
default: 2
Cooldown before another notification is sent.
Player:Pass()
This function is deprecated and may be removed in a future version.
Get a player's pass.
Returns
-
optional string
The current pass or nil if none.
See Also
Player:PrintRadius(message, radius, pos)
View source »Prints a message to players within a radius of a specified position.
Parameters
-
message
string
Message to print.
-
radius
int
The radius to print within.
-
pos
Vector
default: self:GetPos()
Position to center the printing on.
Player:RPName()
View source »Get a player's RP name.
Returns
Player:RPPoints()
View source »Get a player's RPPoint count.
Returns
-
int
Player:RemoveInjured()
View source »Remove a user's injured state
Player:SayDistress(text)
View source »Say a message as a distress broadcast.
Parameters
-
text
string
Message to send.
Player:SayRadio(text)
View source »Say a message as a radio broadcast.
Parameters
-
text
string
Message to send.
Player:SetAdminHelpEnabled(value)
View source »Set the player's admin help status
Parameters
-
value
bool
optional
Admin Help Status
Player:SetAdminHelpNLRToggled(value)
View source »Sets the player's NLR helper is enabled.
Parameters
-
value
bool
optional
NLR helper toggle status.
Player:SetAdminHelpToggled(value)
View source »Sets the player's admin help.
Parameters
-
value
bool
optional
Admin Help Toggle
Player:SetAssociate(value)
View source »Sets the player's new pass
Parameters
-
value
string
optional
Associate type.
Player:SetCanIC(value)
View source »Sets the player's new pass
Parameters
-
value
bool
New CanIC value
Player:SetCanLOOC(value)
View source »Sets the player's new pass
Parameters
-
value
bool
New CanLOOC value
Player:SetFakeSteamName(value)
View source »Set's a player's fake steam name.
Parameters
-
value
bool
optional
hidden.
Player:SetHidden(value)
View source »Sets the player's hidden status.
Parameters
-
value
bool
optional
hidden.
Player:SetLastDeath(value)
View source »Set's a player's last death timestamp.
Parameters
-
value
bool
optional
hidden.
Player:SetLastDeathLoc(value)
View source »Set's a player's last death location name.
Parameters
-
value
bool
optional
hidden.
Player:SetLastDeathPos(value)
View source »Set's a player's last death position.
Parameters
-
value
bool
optional
hidden.
Player:SetLocalNetVar(string, any)
View source »Set a local variable, which will only be networked to the player this is set on
Parameters
-
string
key The key of the variable
-
any
value The value of the variable
Player:SetNSVar(key, val)
This function is deprecated and may be removed in a future version.
Set a network variable on a player
Parameters
-
key
-
val
See Also
Entity:SetNetVar(Entity, string, any)
View source »Set a variable on this entity, which will be networked to all players
Parameters
-
Entity
ent The entity to network the variable to
-
string
key The key of the variable
-
any
value The value of the variable
Player:SetOOCMessageCount(count)
View source »Sets if a player is in a quiz.
Parameters
-
count
int
optional
The number of recently sent OOC messages.
Player:SetOverridePropLimit(val)
View source »Set a user's overridden proplimit.
Parameters
-
val
Player:SetPass(value)
View source »Sets the player's new pass
Parameters
-
value
string
optional
New pass type.
Player:SetPlayerModel(model)
This function is deprecated and may be removed in a future version.
Set a players model.
Parameters
-
model
Player:SetPlayerName(name)
This function is deprecated and may be removed in a future version.
Set a players roleplay name.
Parameters
-
name
Player:SetPursuitPlate(value)
View source »Set's a player's last scanned license plate.
Parameters
-
value
string
optional
hidden.
Player:SetPursuitVehicle(value)
View source »Set's a player's last scanned vehicle name.
Parameters
-
value
string
optional
hidden.
Player:SetQuizEntered(value)
View source »Sets if a player is in a quiz.
Parameters
-
value
bool
optional
In Quiz?
Player:SetScanTime(value)
View source »Set's a player's last scanned vehicle timestamp.
Parameters
-
value
number
optional
hidden.
Player:SupporterGate(action)
View source »Check for a player's supporter status, and warn the player if they do not have the status.
Parameters
-
action
string
default: "do that"
Action to warn for.
Returns
-
bool
Allowed?
Player:SupporterPlusGate(action)
View source »Check for a player's supporter status, and warn the player if they do not have the status.
Parameters
-
action
string
default: "do that"
Action to warn for.
Returns
-
bool
Allowed?
Player:SupporterPlusWarning(action)
View source »Create a formatted warning for a given action.
Parameters
-
action
string
default: "do that"
Action to warn for.
Returns
-
string
Formatted Warning.
Player:SupporterWarning(action)
View source »Create a formatted warning for a given action.
Parameters
-
action
string
default: "do that"
Action to warn for.
Returns
-
string
Formatted Warning.
Player:SyncNetworkVars()
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Sync all network applicable variables to a player This will send everything they can receieve, it's intended for when a player joins but likely has other uses
Player:SyncPropLimit()
View source »Send the prop limit to the client.
Player:TakeMoney(value, reason)
View source »Remove an amount of money from a player.
Parameters
-
value
int
default: 0
Money to remove.
-
reason
string
default: ""
Reason for money being removed.
Player:TakeTrueDamage(damageAmount)
View source »Emulates TakeDamage function to work for players in vehicles
Parameters
-
damageAmount
Player:TalkingOverRadio()
View source »Get if a player is talking over radio.
Returns
-
bool
Player:VehicleAccess(vehicle)
View source »Check if a player has access to a vehicle.
Parameters
-
vehicle
Vehicle
Vehicle to check access for.
Returns
-
bool
Player:Warrant(class)
View source »Set a player's warrant.
Parameters
-
class
optional string
Player:addMoney(value, reason)
View source »Give a player an amount of money.
Parameters
-
value
int
default: 0
Money to give.
-
reason
string
default: ""
Reason for money being given.
See Also
Player:canAfford()
View source »Check if a player can afford an amount of money.
Returns
-
bool
See Also
Player:getLocation()
View source »Function that returns the current location of the player.
Returns
-
string
location name.
Player:printMessage(message)
View source »Prints a message to a player's chat area and console.
Parameters
-
message
string
Message to send.