core.metatables.sv_player
(no description)
Functions
Blind(boolean)
View source »Function to (un)blindfold a player.
Parameters
-
boolean
CanAfford(amount)
View source »Check if a player can afford an amount of money.
Parameters
-
amount
Demote()
View source »Demote a player from their current team.
DoorAccess(door)
View source »Check if a player has access to a door.
Parameters
-
door
GetDefaultPropLimit()
View source »Get a user's default proplimit. This takes into account rank.
GetOverridePropLimit()
View source »Get a user's overridden proplimit. This can only be set by command.
GetPoliceRank()
View source »Get a player's police rank.
GetPropLimit()
View source »Get a user's real proplimit. This is a combination of the above two.
GiveMoney(value, reason)
View source »Give a player an amount of money.
Parameters
-
value
-
reason
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
-
class
-
cooldown
PrintRadius(message, radius, pos)
View source »Prints a message to players within a radius of a specified position.
Parameters
-
message
-
radius
-
pos
RemoveInjured()
View source »Remove a user's injured state
SayDistress(text)
View source »Say a message as a distress broadcast.
Parameters
-
text
SayRadio(text)
View source »Say a message as a radio broadcast.
Parameters
-
text
SetOverridePropLimit(val)
View source »Set a user's overridden proplimit.
Parameters
-
val
SyncPropLimit()
View source »Send the prop limit to the client.
TakeMoney(value, reason)
View source »Remove an amount of money from a player.
Parameters
-
value
-
reason
TakeTrueDamage(damageAmount)
View source »Emulates TakeDamage function to work for players in vehicles and ignore armor
Parameters
-
damageAmount
UpdateInvLegacy(uniqueID, amount, client, force)
This function is deprecated and may be removed in a future version.
Update the players main inventory This is intended as a partial replacement of cityrp.inventory.update, it only exists for legacy support and should not be used for anything new. If amount is positive, it'll create the item, if negative, it'll remove the item. This isn't recommended, it's only here for legacy support. See inventory docs for what you should be using.
Parameters
-
uniqueID
string
The uniqueID of the item to add
-
amount
number
The amount of the item to add or remove
-
client
Player
optional
The client who made this item, if creating. Defaults to the person you are calling it on.
-
force
bool
optional
If true, the item will be added even if the player is over their limit. If removing, this will remove the item even if it isn't stackable NOT RECOMMENDED
Returns
-
bool
success
-
string
reason if not successful
ValidState()
View source »This checks if the player state is valid Checks the following: Alive, Stunned, Arrested, KnockedOut, Injured, FatalInjured
VehicleAccess(vehicle)
View source »Check if a player has access to a vehicle.
Parameters
-
vehicle
Warrant(class)
View source »Set a player's warrant.
Parameters
-
class
optional string
addMoney(value, reason)
View source »Give a player an amount of money.
Parameters
-
value
-
reason
See Also
canAfford()
View source »Check if a player can afford an amount of money.
See Also
printMessage(message)
View source »Prints a message to a player's chat area and console.
Parameters
-
message