Class Player
Shared Player Metafunctions.
Class Overview
Methods
| Player:CanStaffChat() | Check if a player can view staff chat. |
| Player:Nick() | Get a player's nickname. |
| Player:IsOutside() | Check if a player is outside. |
| Player:GenderWord() | Return the appropiate word for the player's gender. |
| Player:IsGovernment() | Check if player is Pres, VP, SS, Swatleader, Swat, NDS, Policecleader, Police, Paramedic, Fireman |
| Player:IsPresident() | Check if player is Pres or VP. |
| Player:IsPresidentAdministration() | Check if player is Pres, VP or NDS. |
| Player:IsLawenforcement() | Check if player is a law enforcer (SS, Cop, SWAT) |
| Player:IsSwat() | Check if player is a SWAT member. |
| Player:IsPolice() | Check if player is a Police Officer. |
| Player:IsRescue() | Check if player is a rescue worker (EMS / Fire). |
| Player:IsRebel() | Check if player is a Rebel or Rebel Leader. |
| Player:IsMafia() | Check if player is a Mafia or Mafia Leader. |
| Player:IsSecretService() | Check if player is a Secret Service Agent (Or Lead). |
| Player:IsActualPresident() | Check if player is the President. |
| Player:IsVicePresident() | Check if player is the VP. |
| Player:IsSwatLeader() | Check if player is the SWAT Leader. |
| Player:IsSSLeader() | Check if player is the SS Lead. |
| Player:IsNexusDeskSecretary() | Check if player is a Secretary. |
| Player:IsParamedic() | Check if player is a Paramedic. |
| Player:IsFireman() | Check if player is a Fireman. |
| Player:IsFirechief() | Check if player is the Firechief. |
| Player:IsSecurityGuard() | Check if player is a Security Guard. |
| Player:IsChef() | Check if player is a Chef. |
| Player:IsDoctor() | Check if player is a doctor. |
| Player:IsChauffeur() | Check if player is a taxi driver. |
| Player:IsArmsDealer() | Check if player is a gundealer. |
| Player:IsBlackmarketDealer() | Check if player is a BMD. |
| Player:IsMechanic() | Check if player is a mechanic. |
| Player:IsMafiaDon() | Check if player is the Don. |
| Player:IsRebelLeader() | Check if player is the Rebel Leader. |
| Player:IsPoliceCommander() | Check if player is the Police Commander. |
| Player:getTeamGroup() | Get the current team group the player is in. |
| Player:GetSVRank() | Get the player's rank. |
| Player:IsRank(rank) | Check if a player is a specified rank. |
| Player:IsUserGroup(rank) | Check if a player is a specified rank. |
| Player:IsOwner() | Checks if the player is of the owner rank. |
| Player:IsSuperDeveloper() | Checks if the player has SuperDev permissions (Owner or SD) |
| Player:IsSuperAdmin() | Checks if the player has SuperDev permissions (SuperDev perms or SuperAdmin rank) |
| Player:IsDeveloper() | Checks if the player has Developer permissions (SuperDev or Developer Rank) |
| Player:IsAdmin() | Checks if the player has Administrative permissions (Developer, SuperAdmin or admin rank.) |
| Player:IsDevMod2() | Checks if the player has Developer Mod Stage 2 permissions (Developer, developermod2 rank.) |
| Player:IsModerator2() | Checks if the player has Mod Stage 2 permissions (DevMod2, Admin or moderator2 rank.) |
| Player:IsDevMod() | Checks if the player has Developer Mod permissions (DeveloperMod Stage 2, developermod rank.) |
| Player:IsModerator() | Checks if the player has Mod permissions (DevMod, Mod2 or moderator rank.) |
| Player:IsTrialDevMod() | Checks if the player has TDevMod permissions (DevMod or trialdevmod rank) |
| Player:IsTrialMod() | Checks if the player has TMod permissions (TDMod, Mod or trialmoderator rank) |
| Player:IsDeveloperOnly() | Checks if the player has DevOnly permissions (TDMod or developeronly rank) |
| Player:IsContributor() | Checks if the player has Contrib permissions (DevOnly or contributor rank) |
| Player:IsAssistant(strict) | Checks if the player has Assistant permissions (DevOnly for loose checks, trial mod or assistant rank) |
| Player:IsVeteran() | Checks if the player is a veteran. |
| Player:IsBusinessAdvisor() | Checks if the player is a business advisor. |
| Player:IsSecurityOfficer() | Checks if the player is a security officer. |
| Player:IsCore() | Checks if the player is a core team member. |
| Player:IsStreamer() | Checks if a player is a streamer. |
| Player:Name(replace) | Gets a player's OOC name, dependent on U/C settings. |
| Player:RPName() | Get a player's current IC name. |
| Player:getLocation() | Get the current location of the player. |
| Player:Arrested() | Check if a player is arrested. |
| Player:Hostaged() | Check if a player is hostaged. |
| Player:Blindfolded() | Check if a player is blindfolded. |
| Player:Sleeping() | Check if a player is sleeping. |
| Player:Cuffed() | Check if a player is cuffed. |
| Player:Frozen() | Check if a player is frozen/physgunfrozen. |
| Player:Ziptied() | Check if a player is ziptied. |
| Player:Gagged() | Check if a player is gagged. |
| Player:Tranqed() | Check if a player is tranq'd. |
| Player:Stunned() | Check if a player is tased. |
| Player:Injured() | Check if a player is injured. |
| Player:KnockedOut() | Check if a player is knocked out. |
| Player:Warranted() | Check if a player is warrant. |
| Player:Pass() | Check if a player has a pass. |
| Player:Job() | Get a player's job. |
| Player:Description() | Get a player's description. |
| Player:Status() | Get a player's status. |
| Player:TweetName() | Get a player's tweet name. |
| Player:Clan() | Get a player's clan name and rank. |
| Player:ClanName() | Get a player's clan name. |
| Player:ClanID() | Get a player's clan ID. |
| Player:MembershipLevel() | Get a player's membership level. |
| Player:Masked() | Check if a player is currently masked. |
| Player:REP(cat) | Get a player's REP. |
| Player:GetPropLimit() | Get the player's prop limit. |
| Player:HasTags() | Check if the current user's name has tags for their rank in it. |
| Player:GetInjuryState() | Return an injury state, based on the player's current HP and injured state. |
| Player:HasGodMode() | Check if a player has god mode. |
| Player:GetRankKey() | Determine the rank key for a player. |
| Player:GetIcon() | Get the rank icon for a player. |
| Player:GetIconMaterial() | Get the rank material for a player. |
| Player:GetIconReplacement() | Get the rank icon's textual replacement for a player. |
| Player:GetRankName() | Get the name of a given player's rank. |
| Player:GetRankColor() | Get the colour for a given player's rank. |
| Player:GetRankSortOrder() | Get the sort order for a given player's rank. |
| Player:GetAgendaGroup() | Get the agenda group the player is in. |
| Player:GetAgendaLeader() | Get the agenda group the player leads. |
| Player:GetPlayerChatColour() | Get the player's chat colour. |
| Player:Noclipping() | Get the players noclip state. |
| Player:MembershipExpires() | Get the time that a users' membership expires. |
| Player:HasMembership() | Check if the player currently has active membership. |
| Player:EventMgr() | Returns if the player has Event Manager permissions. |
| Player:GetFace() | Get the current face ID of the player. |
| Player:PlaySound(soundOrPath[, playServerSide=false[, volume=1[, level=75[, pitch=100[, channel=CHAN_AUTO]]]]]) | Plays a sound for the player, either serverside (EmitSound) or clientside (surface.PlaySound). |
| Player:Notify(message[, class[, priority=false]]) | Send a notification message to a player. |
| Player:NotifyTarget(tArg, plys) | Send an error message to a player saying that they matched multiple players with a command target. |
| Player:NotifyCustom(message[, icon[, colour[, length=3]]]) | Send a notification message to a player. |
| Player:NotifyChoice(message[, button1[, function1[, button2[, function2[, icon[, color[, dismissable=false]]]]]]]) | Send a notification message to a player, with clickable buttons to effect commands. |
| Player:NotifyCenter(message, icon, color, delay, showinconsole) | Send a notification to the center of a player's screen. |
| Player:printMessage(message) | Send a message to a player. |
| Player:PrintRadius(msg, pos, rad) | Prints a message to players within a radius of a specified position. |
| Player:Blind(bool) | Manage a players blindfolded state. |
| Player:GiveDoor(door, name, unsellable, lock) | Give a door to a player. |
| Player:TakeDoor(door) | Take a door from a player, including child doors. |
| Player:SayRadio(text) | Send a message as a radio broadcast. |
| Player:SayDistress(text) | Say a message as a distress broadcast. |
| Player:Emote(text) | Send a message as an action performed by the player. |
| Player:EnvironmentalEmote(text) | Send a message as an environmental action around a player. |
| Player:Demote() | Demote a player from their current team. |
| Player:PromoteLeader() | Promotes a player to team leader. |
| Player:HasHolsteredWeapons() | Check if a player has any holstered weapons. |
| Player:HasTempHolsteredWeapons() | Check if a player has any temporary holstered weapons. |
| Player:ResetTempHolsteredWeapons() | Reset a player's holstered weapons. |
| Player:RemoveHolstered() | Removes Holstered weapons/mods from inventory |
| Player:HolsterAll(invrem, tablerem) | Holsters all of a player's weapons. |
| Player:TemporaryHolsterAll() | Holsters all of a player's weapons temporaryly (ex for being cuffed). |
| Player:UnHolsterTemporary() | UnHolsters all of a player's temporary-holstered weapons. |
| Player:DoorAccess(door) | Check if a player has access to lock a door. |
| Player:VehicleAccess(veh) | Check if a player has access to a vehicle. |
| Player:CanAfford(amt) | Check if a player can afford an amount of money. |
| Player:GiveMoney(amt) | Give a player an amount of money. |
| Player:Warrant(class) | Warrant or unwarrant a player. |
| Player:Arrest(boolean, reset) | Arrest or unarrest a player. |
| Player:Bleed(boolean, seconds) | Make a player bleed or stop them from bleeding. |
| Player:RestoreGovMods() | Restores government mods only in case of disarm or similar situation. |
| Player:Injure(attacker, damageInfo) | Injure a player. |
| Player:LightSpawn() | "Lightly" spawn a player. |
| Player:ChangeModel(model, concom, string) | Change the model of a player. |
| Player:ChangeSkin(skin, nomodelchange) | Change the player's active skin. |
| Player:LoadData() | Load a player's data. |
| Player:LoadData2(result) | Load the player's data from the result table. |
| Player:LoadDataNew() | Load data for a new player. |
| Player:SaveData(create) | Save a player's data. |
| Player:SetSalary() | Set a player's salary based on third party adjustments. |
| Player:RefundAllAmmo() | Refund all ammo currently loaded onto a player. |
| Player:GetDefaultPropLimit() | Get a player's default (unmodified) prop limit. |
| Player:SetPropLimit(limit) | Set a player's custom prop limit. |
| Player:GodEnable() | Enable god mode for a player. |
| Player:GodDisable() | Disable god mode for a player. |
| Player:RestoreDefaultEquipment(force) | Restore a player's default equipment. |
| Player:GetDefaultModel() | Get a player's default (team) model. |
| Player:RestoreDefaultModel() | Restore a player's default model. |
| Player:RestoreDefaultModelTimed(emote, post) | Reset a player's default model, using the regular 10 second timer. |
| Player:ChatPrintF(format, formatting) | Add a chat print message which has been passed through string.format |
| Player:SetMembershipExpires(expires) | Set when a player's membership expires. |
| Player:EnableEventMgr() | Enables Event Manager permissions for player. |
| Player:DisableEventMgr() | Disables Event Manager permissions for player. |
- Player:CanStaffChat()
-
Check if a player can view staff chat.
Returns:
-
bool
If the player can use staff chat.
- Player:Nick()
-
Get a player's nickname.
Returns:
-
string The player's nickname.
- Player:IsOutside()
-
Check if a player is outside.
Returns:
-
bool
If the player is outside.
- Player:GenderWord()
-
Return the appropiate word for the player's gender.
Returns:
-
string
The word for the gender.
- Player:IsGovernment()
-
Check if player is Pres, VP, SS, Swatleader, Swat, NDS, Policecleader, Police, Paramedic, Fireman
Returns:
-
bool
If the player is a government member.
- Player:IsPresident()
-
Check if player is Pres or VP.
Returns:
-
bool
If the player is a the President or Vice President.
- Player:IsPresidentAdministration()
-
Check if player is Pres, VP or NDS.
Returns:
-
bool
If the player is a the President, Vice President or NDS.
- Player:IsLawenforcement()
-
Check if player is a law enforcer (SS, Cop, SWAT)
Returns:
-
bool
If the player is a law enforcer.
- Player:IsSwat()
-
Check if player is a SWAT member.
Returns:
-
bool
If the player is a SWAT member.
- Player:IsPolice()
-
Check if player is a Police Officer.
Returns:
-
bool
If the player is a Police Officer.
- Player:IsRescue()
-
Check if player is a rescue worker (EMS / Fire).
Returns:
-
bool
If the player is a rescue worker.
- Player:IsRebel()
-
Check if player is a Rebel or Rebel Leader.
Returns:
-
bool
If the player is a Rebel.
- Player:IsMafia()
-
Check if player is a Mafia or Mafia Leader.
Returns:
-
bool
If the player is a Mafia Member.
- Player:IsSecretService()
-
Check if player is a Secret Service Agent (Or Lead).
Returns:
-
bool
If the player is SS.
- Player:IsActualPresident()
-
Check if player is the President.
Returns:
-
bool
If the player is the President.
- Player:IsVicePresident()
-
Check if player is the VP.
Returns:
-
bool
If the player is the VP.
- Player:IsSwatLeader()
-
Check if player is the SWAT Leader.
Returns:
-
bool
If the player is the SWAT LEader.
- Player:IsSSLeader()
-
Check if player is the SS Lead.
Returns:
-
bool
If the player is the SS Lead.
- Player:IsNexusDeskSecretary()
-
Check if player is a Secretary.
Returns:
-
bool
If the player is a Secretary.
- Player:IsParamedic()
-
Check if player is a Paramedic.
Returns:
-
bool
If the player is a Paramedic.
- Player:IsFireman()
-
Check if player is a Fireman.
Returns:
-
bool
If the player is a Fireman.
- Player:IsFirechief()
-
Check if player is the Firechief.
Returns:
-
bool
If the player is the Firechief.
- Player:IsSecurityGuard()
-
Check if player is a Security Guard.
Returns:
-
bool
If the player is a Security Guard.
- Player:IsChef()
-
Check if player is a Chef.
Returns:
-
bool
If the player is a Chef.
- Player:IsDoctor()
-
Check if player is a doctor.
Returns:
-
bool
If the player is a doctor.
- Player:IsChauffeur()
-
Check if player is a taxi driver.
Returns:
-
bool
If the player is a taxi driver.
- Player:IsArmsDealer()
-
Check if player is a gundealer.
Returns:
-
bool
If the player is a gundealer.
- Player:IsBlackmarketDealer()
-
Check if player is a BMD.
Returns:
-
bool
If the player is a BMD.
- Player:IsMechanic()
-
Check if player is a mechanic.
Returns:
-
bool
If the player is a mechanic.
- Player:IsMafiaDon()
-
Check if player is the Don.
Returns:
-
bool
If the player is the Don.
- Player:IsRebelLeader()
-
Check if player is the Rebel Leader.
Returns:
-
bool
If the player is the Rebel Leader.
- Player:IsPoliceCommander()
-
Check if player is the Police Commander.
Returns:
-
bool
If the player is the Police Commander.
- Player:getTeamGroup()
-
Get the current team group the player is in.
If there are multiple matches, the first one defined in the TEAMGROUPS table will be used.
Returns:
-
string The group the player is in, "" if none.
- Player:GetSVRank()
-
Get the player's rank.
On server, this always returns the true value (if the player has had their data loaded, as we load from DB.), unless stream override is enabled.
On client, this returns a value based on the true value, current rank and hidden state.
Returns:
-
string User's current rank.
- Player:IsRank(rank)
-
Check if a player is a specified rank.
Parameters:
- rank The rank to check against.
Returns:
-
bool
If the player is the specified rank.
- Player:IsUserGroup(rank)
-
Check if a player is a specified rank.
Parameters:
- rank The rank to check against.
Returns:
-
bool
If the player is the specified rank.
- Player:IsOwner()
-
Checks if the player is of the owner rank.
Returns:
-
bool
If the player is the owner.
- Player:IsSuperDeveloper()
-
Checks if the player has SuperDev permissions (Owner or SD)
Returns:
-
bool
if the player has permissions.
- Player:IsSuperAdmin()
-
Checks if the player has SuperDev permissions (SuperDev perms or SuperAdmin rank)
Returns:
-
bool
if the player has permissions.
- Player:IsDeveloper()
-
Checks if the player has Developer permissions (SuperDev or Developer Rank)
Returns:
-
bool
if the player has permissions.
- Player:IsAdmin()
-
Checks if the player has Administrative permissions (Developer, SuperAdmin or admin rank.)
Returns:
-
bool
if the player has permissions.
- Player:IsDevMod2()
-
Checks if the player has Developer Mod Stage 2 permissions (Developer, developermod2 rank.)
Returns:
-
bool
if the player has permissions.
- Player:IsModerator2()
-
Checks if the player has Mod Stage 2 permissions (DevMod2, Admin or moderator2 rank.)
Returns:
-
bool
if the player has permissions.
- Player:IsDevMod()
-
Checks if the player has Developer Mod permissions (DeveloperMod Stage 2, developermod rank.)
Returns:
-
bool
if the player has permissions.
- Player:IsModerator()
-
Checks if the player has Mod permissions (DevMod, Mod2 or moderator rank.)
Returns:
-
bool
if the player has permissions.
- Player:IsTrialDevMod()
-
Checks if the player has TDevMod permissions (DevMod or trialdevmod rank)
Returns:
-
bool
if the player has permissions.
- Player:IsTrialMod()
-
Checks if the player has TMod permissions (TDMod, Mod or trialmoderator rank)
Returns:
-
bool
if the player has permissions.
- Player:IsDeveloperOnly()
-
Checks if the player has DevOnly permissions (TDMod or developeronly rank)
Returns:
-
bool
if the player has permissions.
- Player:IsContributor()
-
Checks if the player has Contrib permissions (DevOnly or contributor rank)
Returns:
-
bool
if the player has permissions.
- Player:IsAssistant(strict)
-
Checks if the player has Assistant permissions (DevOnly for loose checks, trial mod or assistant rank)
Parameters:
- strict If strict checking is enabled (for REP)
Returns:
-
bool
if the player has permissions.
TODO: This is a pile of shit function fucking burn it.
- Player:IsVeteran()
-
Checks if the player is a veteran.
Returns:
-
bool
If the player is a veteran.
- Player:IsBusinessAdvisor()
-
Checks if the player is a business advisor.
Returns:
-
bool
If the player has the role.
- Player:IsSecurityOfficer()
-
Checks if the player is a security officer.
Returns:
-
bool
- Player:IsCore()
-
Checks if the player is a core team member.
Returns:
-
bool
If the player is a core team member.
- Player:IsStreamer()
-
Checks if a player is a streamer.
This is a rank check, that is staff who activate "streamer mode".
Returns:
-
bool
If streamer mode is active.
- Player:Name(replace)
-
Gets a player's OOC name, dependent on U/C settings.
If replace is true, will attempt to fetch U/C name, or "an administrator" if none is registered.
Otherwise provides regular nickname.
Parameters:
- replace If the name should be replaced by the undercover name (for command echos).
Returns:
-
The players' name, registered U/C name, "An administrator" or "a moderator" dependent on internal state.
- Player:RPName()
-
Get a player's current IC name.
If a fake name is set, it will be returned.
Returns:
-
The player's IC name.
- Player:getLocation()
-
Get the current location of the player.
Returns:
-
string The player's location.
- Player:Arrested()
-
Check if a player is arrested.
Returns:
-
[boolean] The current arrest state.
MakeAccessor("Arrested", "cityrp_arrested")
- Player:Hostaged()
-
Check if a player is hostaged.
Returns:
-
[boolean] The current hostage state.
- Player:Blindfolded()
-
Check if a player is blindfolded.
Returns:
-
The current blindfold state.
- Player:Sleeping()
-
Check if a player is sleeping.
Returns:
-
[boolean] The current sleep state.
- Player:Cuffed()
-
Check if a player is cuffed.
Returns:
-
[boolean] The current cuff state.
- Player:Frozen()
-
Check if a player is frozen/physgunfrozen.
Returns:
-
[boolean] The current freeze state.
- Player:Ziptied()
-
Check if a player is ziptied.
Returns:
-
[boolean] The current ziptie state.
- Player:Gagged()
-
Check if a player is gagged.
Returns:
-
[boolean] The current gag state.
- Player:Tranqed()
-
Check if a player is tranq'd.
Returns:
-
[boolean] The current tranq state.
- Player:Stunned()
-
Check if a player is tased.
Returns:
-
[boolean] The current tase state.
- Player:Injured()
-
Check if a player is injured.
Returns:
-
[boolean] The current injury state.
- Player:KnockedOut()
-
Check if a player is knocked out.
Returns:
-
[boolean] The current knock outage state.
- Player:Warranted()
-
Check if a player is warrant.
Returns:
-
[string | nil] The current warrant type, or nil if none.
- Player:Pass()
-
Check if a player has a pass.
Returns:
-
[string | nil] The current pass or nil if none.
- Player:Job()
-
Get a player's job.
Returns:
-
string The current job.
- Player:Description()
-
Get a player's description.
Returns:
-
string The current description.
- Player:Status()
-
Get a player's status.
Returns:
-
string The current status.
- Player:TweetName()
-
Get a player's tweet name.
Returns:
-
string The current tweet.
- Player:Clan()
-
Get a player's clan name and rank.
Returns:
-
string
The current clan and rank.
- Player:ClanName()
-
Get a player's clan name.
Returns:
-
string
The current clan name.
- Player:ClanID()
-
Get a player's clan ID.
Returns:
-
int
The current clan ID.
- Player:MembershipLevel()
-
Get a player's membership level.
Returns:
-
int
The current membership level.
- Player:Masked()
-
Check if a player is currently masked.
Returns:
-
boolean
Mask state.
- Player:REP(cat)
-
Get a player's REP.
Parameters:
- cat string The category to check, or all if empty.
Returns:
-
int
The number of REPs the player has.
- Player:GetPropLimit()
-
Get the player's prop limit.
Returns:
-
number The prop limit.
- Player:HasTags()
-
Check if the current user's name has tags for their rank in it.
Returns:
-
bool
If the player is currently wearing appropriate tags.
- Player:GetInjuryState()
-
Return an injury state, based on the player's current HP and injured state.
0 = Uninjured
1 = Injured
2 = Seriously Injured
3 = Mortally Wounded
4 = Cardiac Arrest
Returns:
-
number The current injury state.
- Player:HasGodMode()
-
Check if a player has god mode.
Returns:
-
bool
If the player has god enabled.
- Player:GetRankKey()
-
Determine the rank key for a player.
Returns:
-
string
The rank key based on staff rank or membership.
- Player:GetIcon()
-
Get the rank icon for a player.
Returns:
-
string
The rank icon path.
- Player:GetIconMaterial()
-
Get the rank material for a player.
Returns:
-
IMaterial
The rank icon material.
- Player:GetIconReplacement()
-
Get the rank icon's textual replacement for a player.
Returns:
-
string
The replacement.
- Player:GetRankName()
-
Get the name of a given player's rank.
Returns:
-
string
Rank name.
- Player:GetRankColor()
-
Get the colour for a given player's rank.
Returns:
-
Color
Rank Colour.
- Player:GetRankSortOrder()
-
Get the sort order for a given player's rank.
Returns:
-
int
The sort order.
- Player:GetAgendaGroup()
-
Get the agenda group the player is in.
Returns:
-
[string | false] The agenda group the player is in, or false if none.
- Player:GetAgendaLeader()
-
Get the agenda group the player leads.
Returns:
-
[string | false] The agenda group the player leads, or false if none.
- Player:GetPlayerChatColour()
-
Get the player's chat colour.
Returns:
-
colour A cached colour object.
- Player:Noclipping()
-
Get the players noclip state.
Returns:
-
bool
Players noclip state.
- Player:MembershipExpires()
-
Get the time that a users' membership expires.
Returns:
-
number
Unix expiry time.
- Player:HasMembership()
-
Check if the player currently has active membership.
Returns:
-
bool
If the player has membership.
- Player:EventMgr()
- Returns if the player has Event Manager permissions.
- Player:GetFace()
-
Get the current face ID of the player.
Returns:
-
optional number
ID of the face.
- Player:PlaySound(soundOrPath[, playServerSide=false[, volume=1[, level=75[, pitch=100[, channel=CHAN_AUTO]]]]])
-
Plays a sound for the player, either serverside (EmitSound) or clientside (surface.PlaySound).
Parameters:
- soundOrPath string The key in the sound map or full path.
- playServerSide bool If true, plays via EmitSound; else, sends net message to client. (default false)
- volume number Playback volume (0.0–1.0). Defaults to 1.0. (default 1)
- level number Sound attenuation level for EmitSound (default 75). (default 75)
- pitch number Playback pitch. (default 100)
- channel number Sound channel for EmitSound (default CHAN_AUTO). (default CHAN_AUTO)
- Player:Notify(message[, class[, priority=false]])
-
Send a notification message to a player.
Parameters:
- message string The message to send.
- class number The numeric class of the message to send. (optional)
- priority bool A bool representing if the message should overwrite the "showhud" option. Defaults to no. (default false)
- Player:NotifyTarget(tArg, plys)
-
Send an error message to a player saying that they matched multiple players with a command target.
Parameters:
- tArg string The target argument that failed.
- plys tab The players to send.
- Player:NotifyCustom(message[, icon[, colour[, length=3]]])
-
Send a notification message to a player.
Parameters:
- Player:NotifyChoice(message[, button1[, function1[, button2[, function2[, icon[, color[, dismissable=false]]]]]]])
-
Send a notification message to a player, with clickable buttons to effect commands.
Parameters:
- message string The message to send.
- button1 string The tooltip text of the first button. (optional)
- function1 Command to run on click, or table of tables ({{"label", "command"}, {"label 2", "different command"}}) (optional)
- button2 string See button1. (optional)
- function2 See function1. (optional)
- icon string The icon for the message to have. (optional)
- color Color The colour for the message to have. (optional)
- dismissable bool A bool representing if the checkbox should have a "dismiss" option. (default false)
- Player:NotifyCenter(message, icon, color, delay, showinconsole)
-
Send a notification to the center of a player's screen.
Parameters:
- message The message to send.
- icon The icon for the mesage.
- color The colour fo the message.
- delay The time the message will stay on screen.
- showinconsole Boolean for if the message should show in console.
- Player:printMessage(message)
-
Send a message to a player.
Parameters:
- message The message to send.
- Player:PrintRadius(msg, pos, rad)
-
Prints a message to players within a radius of a specified position.
Parameters:
- msg The message to send.
- pos The position to check.
- rad The radius to send within.
- Player:Blind(bool)
-
Manage a players blindfolded state.
Parameters:
- bool If the player should be blindfolded or unblindfolded.
- Player:GiveDoor(door, name, unsellable, lock)
-
Give a door to a player.
Parameters:
- door Entity The door entity to give.
- name string The name of the door to set.
- unsellable bool If the door should be set to be unsellable.
- lock bool If the door should spawn locked.
- Player:TakeDoor(door)
-
Take a door from a player, including child doors.
Parameters:
- door Entity The door entity to take.
- Player:SayRadio(text)
-
Send a message as a radio broadcast.
If the player has sent a /panic call in the last 20 seconds, these are sent as distress class messages, rather than radio class.
Parameters:
- text The message to send.
- Player:SayDistress(text)
-
Say a message as a distress broadcast.
Parameters:
- text The message to send.
- Player:Emote(text)
-
Send a message as an action performed by the player.
Parameters:
- text The message to send.
- Player:EnvironmentalEmote(text)
-
Send a message as an environmental action around a player.
Essentially /it.
Parameters:
- text string The message to send.
- Player:Demote()
- Demote a player from their current team.
- Player:PromoteLeader()
- Promotes a player to team leader.
- Player:HasHolsteredWeapons()
- Check if a player has any holstered weapons.
- Player:HasTempHolsteredWeapons()
- Check if a player has any temporary holstered weapons.
- Player:ResetTempHolsteredWeapons()
- Reset a player's holstered weapons.
- Player:RemoveHolstered()
- Removes Holstered weapons/mods from inventory
- Player:HolsterAll(invrem, tablerem)
-
Holsters all of a player's weapons.
Parameters:
- invrem If the items should also be removed from the inventory.
- tablerem If the items should not be put in holstered tables.
- Player:TemporaryHolsterAll()
- Holsters all of a player's weapons temporaryly (ex for being cuffed).
- Player:UnHolsterTemporary()
- UnHolsters all of a player's temporary-holstered weapons.
- Player:DoorAccess(door)
-
Check if a player has access to lock a door.
Parameters:
- door ent Door to be checked.
Returns:
-
bool
If the player is allowed access to the door.
- Player:VehicleAccess(veh)
-
Check if a player has access to a vehicle.
Parameters:
- veh The vehicle to check access for.
- Player:CanAfford(amt)
-
Check if a player can afford an amount of money.
Parameters:
- amt The money to check against.
- Player:GiveMoney(amt)
-
Give a player an amount of money.
Parameters:
- amt The amount of money to give.
- Player:Warrant(class)
-
Warrant or unwarrant a player.
Parameters:
- class
- Player:Arrest(boolean, reset)
-
Arrest or unarrest a player.
Parameters:
- boolean If the player should be arrested or unarrested.
- reset If the player's status should be reset.
- Player:Bleed(boolean, seconds)
-
Make a player bleed or stop them from bleeding.
Parameters:
- boolean If they should start bleeding.
- seconds How long they should beleed for.
- Player:RestoreGovMods()
- Restores government mods only in case of disarm or similar situation. Mods are not lost on knockout, but are on HolsterAll() (rope, arrest, disarm, etc.)
- Player:Injure(attacker, damageInfo)
-
Injure a player.
Parameters:
- attacker
- damageInfo Give a player a chance to skip injury state
- Player:LightSpawn()
- "Lightly" spawn a player. Ie. don't reset data, don't reset prone state etc.
- Player:ChangeModel(model, concom, string)
-
Change the model of a player.
Parameters:
- Player:ChangeSkin(skin, nomodelchange)
-
Change the player's active skin.
Parameters:
- skin number Skin index to change to.
- nomodelchange bool Argument set if the function is called in isolation (without ChangeModel)
- Player:LoadData()
-
Load a player's data.
Internal:
-
This function is internal. Whilst you can call it, you probably shouldn't.
- Player:LoadData2(result)
-
Load the player's data from the result table.
Internal:
-
This function is internal. Whilst you can call it, you probably shouldn't.
Parameters:
- result
- Player:LoadDataNew()
-
Load data for a new player.
Internal:
-
This function is internal. Whilst you can call it, you probably shouldn't.
- Player:SaveData(create)
-
Save a player's data.
Internal:
-
This function is internal. Whilst you can call it, you probably shouldn't.
Parameters:
- create bool Should the query be an insert or an update.
- Player:SetSalary()
- Set a player's salary based on third party adjustments.
- Player:RefundAllAmmo()
- Refund all ammo currently loaded onto a player.
- Player:GetDefaultPropLimit()
-
Get a player's default (unmodified) prop limit.
Returns:
-
number
Prop Limit, -1 for unlimited.
- Player:SetPropLimit(limit)
-
Set a player's custom prop limit.
Parameters:
- limit optional number Limit to set, nil to reset to the default prop limit.
- Player:GodEnable()
- Enable god mode for a player.
- Player:GodDisable()
- Disable god mode for a player.
- Player:RestoreDefaultEquipment(force)
-
Restore a player's default equipment.
For example, keys, remote keys, toolgun and physgun.
Parameters:
- force
- Player:GetDefaultModel()
-
Get a player's default (team) model.
Returns:
-
string
model path
- Player:RestoreDefaultModel()
- Restore a player's default model. Also unsets their custom model field.
- Player:RestoreDefaultModelTimed(emote, post)
-
Reset a player's default model, using the regular 10 second timer.
Parameters:
- emote string
- post func
- Player:ChatPrintF(format, formatting)
-
Add a chat print message which has been passed through string.format
Parameters:
- format string
- formatting vararg arguments
See also:
- Player:SetMembershipExpires(expires)
-
Set when a player's membership expires.
Parameters:
- expires int New expiry time.
- Player:EnableEventMgr()
- Enables Event Manager permissions for player.
- Player:DisableEventMgr()
- Disables Event Manager permissions for player.