Type Player

Player

Methods

accountID() Returns the player's account ID (SteamID3) as an integer.
activeWeapon() Returns the player's active weapon.
aimEntity() Returns the entity the player is looking at.
aimPos() Returns the position the player is looking at.
aimVector() Returns the player's aim vector.
alive() Returns whether the player is alive.
armor() Returns the player's armour.
crouching() Returns whether the player is crouching.
deaths() Returns the player's deaths count.
exitVehicle() Forces a player to exit the vehicle they are currently sat in.
eyeTrace() Returns an eye trace from the player ignoring the cursor position.
flashlightIsOn() Returns whether the player's flashlight is on.
fov() Returns the player's FOV.
frags() Returns the player's frag count.
getAmmoCount( ammoType ) Returns the amount of ammo the player currently has of the given type.
getEntityInUse() Returns the entity the player is currently using (e.g. a picked up prop).
getFriendStatus() Returns the friend status code for the client running this function.
getShuttle() Returns the shuttle the player is currently seated in.
getTeamColor() Returns the player's team colour.
getTool( toolMode ) Returns the tool object belonging to the player for the given tool mode, or nil if the player has no such tool.
getUserGroup() Returns the player's user group.
getViewEntity() Returns the current view entity of the given player.
hasDamageEnabled() Returns whether the given player is opted into prop damage.
hasPlayerDamageEnabled() Returns whether the given player is opted into player damage.
health() Returns the player's health.
inShuttle() Returns true if the player is seated in a shuttle, false otherwise.
inVehicle() Returns true if the player is in a vehicle.
isAdmin() Returns true if the player is an admin.
isBot() Returns true if the player is a bot.
isConnected() Returns true if the player is connected.
isFrozen() Returns true if the player is frozen.
isMuted() Returns whether the player is muted for the client running this function.
isSprinting() Returns whether the player is sprinting.
isSuperAdmin() Returns true if the player is a super admin.
isUserGroup( group ) Returns true if the player is in the given user group.
jumpPower() Returns the player's jump power.
keyDown( key ) Returns whether the player is holding the given key down.
keyReleased( key ) Returns whether the player has released the given key.
maxArmor() Returns the player's maximum armour.
maxHealth() Returns the player's max health.
maxSpeed() Returns the player's max speed.
name() Returns the player's name.
nick() Returns the player's name.
ping() Returns the player's ping.
runSpeed() Returns the player's run speed.
setVelocity( velocity ) Sets a player's velocity.
shootPos() Returns the player's shoot position.
steamID() Returns the player's Steam ID.
steamID64() Returns the player's 64 bit Steam ID.
team() Returns the player's team ID.
teamName() Returns the player's team name.
uniqueID() Returns the player's unique ID.
userID() Returns the player's user ID.
vehicle() Returns the vehicle the player is in if applicable.


Methods

Player:accountID()
Returns the player's account ID (SteamID3) as an integer.

Environment:

Shared
Player:activeWeapon()
Returns the player's active weapon.

Environment:

Shared
Player:aimEntity()
Returns the entity the player is looking at.

Environment:

Shared
Player:aimPos()
Returns the position the player is looking at.

Environment:

Shared
Player:aimVector()
Returns the player's aim vector.

Environment:

Shared
Player:alive()
Returns whether the player is alive.

Environment:

Shared
Player:armor()
Returns the player's armour.

Environment:

Shared
Player:crouching()
Returns whether the player is crouching.

Environment:

Shared
Player:deaths()
Returns the player's deaths count.

Environment:

Shared
Player:exitVehicle()
Forces a player to exit the vehicle they are currently sat in. This applies only to engine vehicles (e.g. chairs), not scripted vehicles, and can only be triggered for vehicles belonging to the instance owner. This also requires the CONTROL_VEHICLE_INPUT permission to have been granted by the player. Note that the "canexitvehicle" hook will be called by this method.

Environment:

Server

Return values:

  1. (boolean) True if exiting the vehicle succeded, false otherwise.
  2. (string) If exiting failed, the reason why.
Player:eyeTrace()
Returns an eye trace from the player ignoring the cursor position.

Environment:

Shared
Player:flashlightIsOn()
Returns whether the player's flashlight is on.

Environment:

Shared
Player:fov()
Returns the player's FOV.

Environment:

Shared
Player:frags()
Returns the player's frag count.

Environment:

Shared
Player:getAmmoCount( ammoType )
Returns the amount of ammo the player currently has of the given type.

Environment:

Shared

Parameters:

  • ammoType: The type of ammo, get this from Weapon:getPrimaryAmmoType()/Weapon:getSecondaryAmmoType().
Player:getEntityInUse()
Returns the entity the player is currently using (e.g. a picked up prop).

Environment:

Shared

Return value:

    (Entity) The entity currently being used by the given player.
Player:getFriendStatus()
Returns the friend status code for the client running this function.

Environment:

Client
Player:getShuttle()
Returns the shuttle the player is currently seated in.

Environment:

Server
Player:getTeamColor()
Returns the player's team colour.

Environment:

Shared
Player:getTool( toolMode )
Returns the tool object belonging to the player for the given tool mode, or nil if the player has no such tool.

Environment:

Server

Parameters:

  • (string) toolMode: The name of the tool mode to retrieve a tool object for.
Player:getUserGroup()
Returns the player's user group.

Environment:

Shared
Player:getViewEntity()
Returns the current view entity of the given player.

Environment:

Shared
Player:hasDamageEnabled()
Returns whether the given player is opted into prop damage.

Environment:

Server
Player:hasPlayerDamageEnabled()
Returns whether the given player is opted into player damage.

Environment:

Server
Player:health()
Returns the player's health.

Environment:

Shared
Player:inShuttle()
Returns true if the player is seated in a shuttle, false otherwise.

Environment:

Server
Player:inVehicle()
Returns true if the player is in a vehicle.

Environment:

Shared
Player:isAdmin()
Returns true if the player is an admin.

Environment:

Shared
Player:isBot()
Returns true if the player is a bot.

Environment:

Shared
Player:isConnected()
Returns true if the player is connected.

Environment:

Shared
Player:isFrozen()
Returns true if the player is frozen.

Environment:

Shared
Player:isMuted()
Returns whether the player is muted for the client running this function.

Environment:

Client
Player:isSprinting()
Returns whether the player is sprinting.

Environment:

Shared

Return value:

    (boolean) True if the player is sprinting, false otherwise.
Player:isSuperAdmin()
Returns true if the player is a super admin.

Environment:

Shared
Player:isUserGroup( group )
Returns true if the player is in the given user group.

Environment:

Shared

Parameters:

  • group:
Player:jumpPower()
Returns the player's jump power.

Environment:

Shared
Player:keyDown( key )
Returns whether the player is holding the given key down.

Environment:

Shared

Parameters:

  • key: input.IN_ enum.
Player:keyReleased( key )
Returns whether the player has released the given key.

Environment:

Shared

Parameters:

  • key: input.IN_ enum.
Player:maxArmor()
Returns the player's maximum armour.

Environment:

Shared
Player:maxHealth()
Returns the player's max health.

Environment:

Shared
Player:maxSpeed()
Returns the player's max speed.

Environment:

Shared
Player:name()
Returns the player's name.

Environment:

Shared
Player:nick()
Returns the player's name.

Environment:

Shared
Player:ping()
Returns the player's ping.

Environment:

Shared
Player:runSpeed()
Returns the player's run speed.

Environment:

Shared
Player:setVelocity( velocity )
Sets a player's velocity.

Environment:

Server

Parameters:

  • velocity: The new (world) velocity vector.
Player:shootPos()
Returns the player's shoot position.

Environment:

Shared
Player:steamID()
Returns the player's Steam ID.

Environment:

Shared
Player:steamID64()
Returns the player's 64 bit Steam ID.

Environment:

Shared
Player:team()
Returns the player's team ID.

Environment:

Shared
Player:teamName()
Returns the player's team name.

Environment:

Shared
Player:uniqueID()
Returns the player's unique ID.

Deprecated: This value should not be used as it is not truly unique. Use the player's Steam ID where possible.

Environment:

Shared
Player:userID()
Returns the player's user ID.

Environment:

Shared
Player:vehicle()
Returns the vehicle the player is in if applicable.

Environment:

Shared

Valid XHTML 1.0!