players._base module

Provides a class used to interact with a specific player.

class _players.PlayerMixin

Bases: BaseEntity

__init__((object)arg1, (int)entity_index) object
get_view_angle((PlayerMixin)arg1) _mathlib.QAngle :

Returns the player’s view angle.

Return type:

QAngle

is_networked((PlayerMixin)arg1) bool :

Return True if the entity is networked.

Return type:

bool

is_player((PlayerMixin)arg1) bool :

Return True if the entity is a player.

Return type:

bool

is_weapon((PlayerMixin)arg1) bool :

Return True if the entity is a weapon.

Return type:

bool

set_view_angle((PlayerMixin)arg1, (_mathlib.QAngle)arg2[, (_engines._sound.Channel)fixangle=1]) None
snap_to_position((PlayerMixin)arg1[, (_mathlib.Vector)origin=None[, (_mathlib.QAngle)angles=None]]) None :

Teleports the player at the given position and angles.

Parameters:
  • origin (Vector) – The coordinates to teleport the player at.

  • angles (QAngle) – The angles to set the player’s view to.

property active_devices

Get/set the player’s active devices.

Note

Only available in HL2.

Return type:

int

property active_weapon_handle

Get/set the player’s active weapon_handle.

Return type:

int

property armor

Get/set the player’s armor.

Note

Only available in CS:GO and CS:S.

Return type:

int

property buttons

Get/set the player’s currently pressed buttons.

Return type:

float

property cash

Get/set the player’s cash.

Note

Only available in CS:GO and CS:S.

Return type:

int

property dead

Return whether the player is dead.

Return type:

bool

property deaths

Get/set the player’s death count.

Return type:

int

property default_fov

Get/set the player’s default field of view (FOV).

Return type:

int

property desired_player_class

Get/set the player’s desired player class.

Note

Only available in TF2.

Return type:

int

property draw_view_model

Get/set the player’s draw view model.

Return type:

int

property eye_angle

Get/set the player’s eye angle.

Return type:

QAngle

property fall_velocity

Get/set the player’s fall velocity.

Return type:

float

property flags

Get/set the player’s flags.

Return type:

int

property flash_alpha

Get/set the player’s flash alpha.

Note

Only available in CS:GO and CS:S.

Return type:

int

property flash_duration

Get/set the player’s flash duration.

Note

Only available in CS:GO and CS:S.

Return type:

int

property fov

Get/set the player’s field of view (FOV).

Return type:

int

property fov_rate

Get/set the player’s field of view (FOV) rate.

Return type:

float

property fov_start

Get/set the player’s field of view (FOV) start.

Return type:

int

property fov_time

Get/set the player’s field of view (FOV) time.

Return type:

float

property gun_offset

Get/set the player’s gun offset.

Return type:

Vector

property has_defuser

Get/set whether the player has a defuser.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property has_helmet

Get/set whether the player has a helmet.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property hidden_huds

Get/set the player’s hidden HUDs.

Return type:

int

property in_bomb_zone

Get/set whether the player is in a bomb zone.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property in_buy_zone

Get/set whether the player is in a buy zone.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property in_rescue_zone

Get/set whether the player is in a hostage rescue zone.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property is_defusing

Get/set whether the player is currently defusing the bomb.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property is_ducked

Return whether the player is ducked.

Return type:

bool

property is_ducking

Return whether the player is duckeding.

Return type:

bool

property kills

Get/set the player’s kill count.

Return type:

int

property last_hitgroup

Get/set the player’s last hitgroup.

Return type:

int

property last_weapon

Get/set the player’s last weapon.

Return type:

int

property life_state

Get/set the player’s life state.

Return type:

int

property nightvision_on

Get/set whether the player is currently using nightvision.

Note

Only available in CS:GO and CS:S.

Return type:

bool

property observer_mode

Get/set the player’s observer mode.

Return type:

int

property observer_target

Get/set the player’s observer target.

Return type:

int

property phys_damage_scale

Get/set the player’s physical damage scale.

Return type:

float

property place

Get/set the player’s current place.

Return type:

str

property player_class

Get/set the player’s player class.

Return type:

int

property player_state

Get/set the player’s player state.

Return type:

int

property ragdoll

Get/set the player’s ragdoll.

Return type:

int

property relationship

Get/set the player’s relationship.

Return type:

str

property shots_fired

Get/set the the number of shots fired by the player.

Note

Only available in CS:GO and CS:S.

Return type:

int

property speed

Get/set the player’s speed.

Return type:

float

property stamina

Get/set the player’s stamina.

Note

Only available in CS:GO and CS:S.

Return type:

float

property suit_power_load

Get/set the player’s suit power load.

Note

Only available in HL2.

Return type:

float

property view_angle

Get/set the player’s view angle.

Return type:

QAngle

property view_offset

Get/set the player’s view offset.

Return type:

Vector

property view_vector

Get/set the player’s view vector.

Return type:

Vector