core.metatables.sh_player
(no description)
Functions
CanFit(item)
View source »Checks if the player can fit the given item (or size)
Parameters
-
item
Returns
-
bool
CustomPass()
View source »Check a player's custom pass title.
Returns
-
optional string
The custom pass title or nil if none.
GenderWord()
This function is deprecated and may be removed in a future version.
Get the possessive pronoun for this player.
GenderWord2()
This function is deprecated and may be removed in a future version.
Get the pronoun for this player.
GetAssociate()
View source »Check if a player has is a group associate.
Returns
-
optional string
Pass name
GetCanIC()
View source »Check if a player can speak in IC chats.
GetCanLOOC()
View source »Check if a player can speak in LOOC.
GetFakeSteamName()
View source »Gets a player's fake steam name.
GetGender()
View source »Get a players gender.
GetGenderAdjectivePronoun()
View source »Get the gendered adjective pronoun for the player.
GetGenderDemonstrativePronoun()
View source »Get the gendered demonstrative pronoun for the player.
GetGenderPosessessivePronoun()
View source »Get the gendered posessive pronoun for the player.
GetGenderPronoun()
View source »Get the gendered pronoun for the player.
GetGenderReflexivePronoun()
View source »Get the gendered reflexive pronoun for the player.
GetGenderTitle()
View source »Get the title of the gender for the player.
GetInventory()
View source »Get a player's main inventory
Returns
-
Inventory
GetItemCount(string)
View source »Get how much of an certain item a player has in their main inventory
Parameters
-
string
uniqueID
Returns
-
item if found, false otherwise
GetLastDeath()
View source »Gets a player's last death timestamp.
GetLastDeathLoc()
View source »Gets a player's last death location name.
GetLastDeathPos()
View source »Gets a player's last death position.
GetOOCMessageCount()
View source »Gets the number of OOC messages a player has recently sent.
GetPass()
View source »Get a player's pass.
Returns
-
optional string
Pass name
GetPlayerModel()
This function is deprecated and may be removed in a future version.
Get a players model.
GetPlayerName()
This function is deprecated and may be removed in a future version.
Get a players name
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".
GetPursuitPlate()
View source »Gets a player's last scanned license plate.
GetPursuitVehicle()
View source »Gets a player's last scanned vehicle name.
GetRankColor()
View source »Get a player's rank color.
GetRankData()
View source »Gets rank data for a player.
Returns
-
optional table
GetRankDisplayOrder()
View source »Get a ranks display order.
GetRankIcon()
View source »Get a rank's rank icon.
GetRankIconMaterial()
View source »Get a precached rank icon material.
Returns
-
IMaterial
GetRankIconString()
View source »Get the string representation of a rank icon.
GetRankName()
View source »Get a player's rank name.
GetRankPhysgunColor()
View source »Get a rank's physgun color.
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.
See Also
GetScanTime()
View source »Gets a player's last scanned vehicle timestamp.
HasAdminHelpEnabled()
View source »Check if a player has admin help enabled.
HasAdminHelpNLRToggled()
View source »Check if a player's NLR helper is enabled.
HasAdminHelpToggled()
View source »Check if the player's admin help is toggled.
HasItem(string)
View source »Check if a player has an item in their main inventory
Parameters
-
string
uniqueID
Returns
-
item if found, false otherwise
HasRPPoints(count)
View source »Check if a player has a given number of RP Points.
Parameters
-
count
HasTags()
View source »Check if a player has tags which match with their rank.
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.
IsAFK()
View source »Check if a player is afk.
IsAdmin()
View source »Check if the player holds admin permissions.
IsContributor()
View source »Gets if a player is a contributor.
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.
See Also
IsDeveloper()
View source »Check if the player is a developer.
IsDeveloperAdmin()
View source »Check if the player holds developer & admin permissions
IsDeveloperOnly()
View source »Once again, this is used in a LOT of places.
See Also
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.
See Also
IsDeveloperTrialAdmin()
View source »Check if the player has developer & trial admin permissions.
IsDonator()
This function is deprecated and may be removed in a future version.
Use ??? or ???
Gets if a player is a donator.
See Also
IsERU()
View source »Check if a player is a ERU member.
IsEventCoordinator()
View source »Check if the player is an event coordonator.
IsEventManager()
View source »Check if the player is an event manager.
IsFLTeamMember()
View source »Get if the player is a team member.
IsFemale()
View source »Check if a player is female
Returns
-
bool Is the player female
IsGovernment()
View source »Check if a player is a member of the government.
IsHidden()
View source »Check if a player is hidden.
IsHidingRank()
View source »Check if a player's rank is hidden from their lack of tags.
IsLawEnforcement()
View source »Check if a player is a member of law enforcement.
IsMafia()
View source »Check if a player is a corelone.
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.
See Also
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.
See Also
IsOutside()
View source »Check if a player is outside.
IsOwner()
View source »Check if the player holds the owner permissions.
IsPolice()
View source »Check if a player is a police officer.
IsPresident()
View source »Check if a player is a president.
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.
IsQuizEntered()
View source »Gets if a player is in a quiz.
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
IsRebel()
View source »Check if a player is a rebel.
IsSWAT()
View source »Check if a player is a swat officer.
IsSpectator()
View source »Check if a player is a spectator.
IsSuperAdmin()
View source »Check if the player holds super admin permissions.
IsSuperDeveloper()
View source »Check if the player holds super developer permissions.
IsTeamGroup(group)
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).
IsTrialAdmin()
View source »Check if a player has trial admin permissions.
IsTrialAdminOnly()
View source »Check if the player is exclusively a trial admin (not including inheritance).
IsUserGroup(rank)
View source »Check if the player is a given rank.
Parameters
-
rank
string
Returns
-
bool
If the player is the rank.
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.
See Also
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.
Nick()
View source »Get a player's (possibly faked) steam name.
See Also
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
See Also
Player.GetUserGroup()
View source »Get the player's rank.
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
PlayerNSAccessor(name, key, iForce, default, readPrefix, optional)
View source »Add a pair of getter/setters to the player metatable.
Parameters
-
name
-
key
-
iForce
-
default
-
readPrefix
-
optional
PlayerNSReader(name, key, FORCE, default, prefix)
View source »Add a Getter to the Player metatable.
Parameters
-
name
string
The name to set for the getter.
-
key
string
The NSVar key to read.
-
FORCE
int
optional
enum to use.
-
default
Default value.
-
prefix
string
Prefix to use for the getter, if Get/Is isn't allowable.
PlayerNSWriter(name, key, FORCE)
View source »Add a Setter to the Player metatable.
Parameters
-
name
string
The name to set for the setter.
-
key
string
The NSVar key to write.
-
FORCE
int
optional
enum to use.
RPName()
View source »Get a player's RP name.
RPPoints()
View source »Get a player's RPPoint count.
SetAdminHelpEnabled()
View source »Set the player's admin help status
SetAdminHelpNLRToggled()
View source »Sets the player's NLR helper is enabled.
SetAdminHelpToggled()
View source »Sets the player's admin help.
SetAssociate()
View source »Sets the player's new pass
SetCanIC(value)
View source »Sets the player's new pass
Parameters
-
value
bool
New CanIC value
SetCanLOOC(value)
View source »Sets the player's new pass
Parameters
-
value
bool
New CanLOOC value
SetFakeSteamName()
View source »Set's a player's fake steam name.
SetHidden()
View source »Sets the player's hidden status.
SetLastDeath()
View source »Set's a player's last death timestamp.
SetLastDeathLoc()
View source »Set's a player's last death location name.
SetLastDeathPos()
View source »Set's a player's last death position.
SetOOCMessageCount()
View source »Sets if a player is in a quiz.
SetPass()
View source »Sets the player's new pass
SetPlayerModel(model)
This function is deprecated and may be removed in a future version.
Set a players model.
Parameters
-
model
SetPlayerName(name)
This function is deprecated and may be removed in a future version.
Set a players roleplay name.
Parameters
-
name
SetPursuitPlate()
View source »Set's a player's last scanned license plate.
SetPursuitVehicle()
View source »Set's a player's last scanned vehicle name.
SetQuizEntered()
View source »Sets if a player is in a quiz.
SetScanTime()
View source »Set's a player's last scanned vehicle timestamp.
TalkingOverRadio()
View source »Get if a player is talking over radio.
getLocation()
View source »Function that returns the current location of the player.