players._base module

Provides a class used to interact with a specific player.

class _players.PlayerMixin

Bases: _entities._entity.BaseEntity

__init__((object)arg1, (int)entity_index) → object
get_view_angle((PlayerMixin)arg1) → 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, (QAngle)arg2[, (Channel)fixangle=1]) → None :

Sets the player’s view angle.

snap_to_position((PlayerMixin)arg1[, (Vector)origin=None[, (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.
active_devices

Get/set the player’s active devices.

Note

Only available in HL2.

Return type:int
active_weapon_handle

Get/set the player’s active weapon_handle.

Return type:int
armor

Get/set the player’s armor.

Note

Only available in CS:GO and CS:S.

Return type:int
buttons

Get/set the player’s currently pressed buttons.

Return type:float
cash

Get/set the player’s cash.

Note

Only available in CS:GO and CS:S.

Return type:int
dead

Return whether the player is dead.

Return type:bool
deaths

Get/set the player’s death count.

Return type:int
default_fov

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

Return type:int
desired_player_class

Get/set the player’s desired player class.

Note

Only available in TF2.

Return type:int
draw_view_model

Get/set the player’s draw view model.

Return type:int
eye_angle

Get/set the player’s eye angle.

Return type:QAngle
fall_velocity

Get/set the player’s fall velocity.

Return type:float
flags

Get/set the player’s flags.

Return type:int
flash_alpha

Get/set the player’s flash alpha.

Note

Only available in CS:GO and CS:S.

Return type:int
flash_duration

Get/set the player’s flash duration.

Note

Only available in CS:GO and CS:S.

Return type:int
fov

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

Return type:int
fov_rate

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

Return type:float
fov_start

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

Return type:int
fov_time

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

Return type:float
gun_offset

Get/set the player’s gun offset.

Return type:Vector
has_defuser

Get/set whether the player has a defuser.

Note

Only available in CS:GO and CS:S.

Return type:bool
has_helmet

Get/set whether the player has a helmet.

Note

Only available in CS:GO and CS:S.

Return type:bool
hidden_huds

Get/set the player’s hidden HUDs.

Return type:int
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
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
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
is_defusing

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

Note

Only available in CS:GO and CS:S.

Return type:bool
is_ducked

Return whether the player is ducked.

Return type:bool
is_ducking

Return whether the player is duckeding.

Return type:bool
kills

Get/set the player’s kill count.

Return type:int
last_hitgroup

Get/set the player’s last hitgroup.

Return type:int
last_weapon

Get/set the player’s last weapon.

Return type:int
life_state

Get/set the player’s life state.

Return type:int
nightvision_on

Get/set whether the player is currently using nightvision.

Note

Only available in CS:GO and CS:S.

Return type:bool
observer_mode

Get/set the player’s observer mode.

Return type:int
observer_target

Get/set the player’s observer target.

Return type:int
phys_damage_scale

Get/set the player’s physical damage scale.

Return type:float
place

Get/set the player’s current place.

Return type:str
player_class

Get/set the player’s player class.

Return type:int
player_state

Get/set the player’s player state.

Return type:int
ragdoll

Get/set the player’s ragdoll.

Return type:int
relationship

Get/set the player’s relationship.

Return type:str
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
speed

Get/set the player’s speed.

Return type:float
stamina

Get/set the player’s stamina.

Note

Only available in CS:GO and CS:S.

Return type:float
suit_power_load

Get/set the player’s suit power load.

Note

Only available in HL2.

Return type:float
view_angle

Get/set the player’s view angle.

Return type:QAngle
view_offset

Get/set the player’s view offset.

Return type:Vector
view_vector

Get/set the player’s view vector.

Return type:Vector