c_base_player
Base player class providing core player functionality including health, movement, view angles, and visibility checks. Source:game/sdk/classes/c_base_player.h:14
Inherits: c_base_combat_character
Network Variables
Current player health (0-100, can exceed 100 with buffs)Netvar:
CBasePlayer::m_iHealthLife state of the player (alive, dying, dead)Netvar:
CBasePlayer::m_lifeStateCurrent tick count for the player’s simulationNetvar:
CBasePlayer::m_nTickBaseOffset from origin to eye positionNetvar:
CBasePlayer::m_vecViewOffset[0]View punch angles (recoil visual effect)Netvar:
CBasePlayer::m_viewPunchAngleAim punch angles (actual recoil affecting bullets)Netvar:
CBasePlayer::m_aimPunchAngleHandle to the player’s first-person view modelNetvar:
CBasePlayer::m_hViewModel[0]Player state flags (on ground, ducking, in water, etc.)Netvar:
CBasePlayer::m_fFlagsCurrent velocity vectorNetvar:
CBasePlayer::m_vecVelocity[0]Maximum movement speed for the playerNetvar:
CBasePlayer::m_flMaxspeedHandle to the entity being spectated (when dead)Netvar:
CBasePlayer::m_hObserverTargetSpeed of the ducking animationNetvar:
CBasePlayer::m_flDuckSpeedDuck animation progress (0.0 = standing, 1.0 = fully ducked)Netvar:
CBasePlayer::m_flDuckAmountName of the last location the player was atNetvar:
CBasePlayer::m_szLastPlaceNameVertical velocity when fallingNetvar:
CBasePlayer::m_flFallVelocityOffsets
Reference to the current user command being processedOffset: 0xCD2
Forced button flagsOffset: 0xCD1
Disabled button flagsOffset: 0xCD0
Methods
Returns reference to the player’s movement type flagReturns: Movement type (walk, noclip, ladder, etc.)
Called before player simulation to update player stateVirtual Index: 318
Called after player simulation to finalize player stateVirtual Index: 319
Selects an item/weapon for the playerParameters:
item- Item namesub_type- Item sub-type
Sets the random seed for predictionParameters:
command- User command containing random seed, ornullptrto clear
Sets the player entity for predictionParameters:
entity- Entity to set as predicted player
Determines how many simulation ticks are neededReturns: Number of simulation ticks
Adjusts the player’s timebase for simulationParameters:
simulation_ticks- Number of ticks to adjust by
Calculates the player’s eye position (camera position)Returns: World position of player’s eyes
Performs ray trace to check if this player can see another playerParameters:
player- Target player to check visibility to
true if target player is visibleChecks if player can see target ignoring walls (only checks if entity is hit)Parameters:
player- Target playerhitgroup- Hitgroup to checkstart- Start positionend- End position
true if ray hits the target playerc_cs_player
CS:GO-specific player class with Counter-Strike gameplay features. Source:game/sdk/classes/c_cs_player.h:12
Inherits: c_base_player
Template Methods
Generic getter for offset-based valuesParameters:
offset- Memory offset from player base
Generic setter for offset-based valuesParameters:
offset- Memory offset from player baseval- Value to set
Network Variables
Whether the player has a defuse kitNetvar:
CCSPlayer::m_bHasDefuserGun game spawn immunity statusNetvar:
CCSPlayer::m_bGunGameImmunityNumber of consecutive shots fired (resets when stopped firing)Netvar:
CCSPlayer::m_iShotsFiredPlayer’s eye angles (where they’re actually looking)Netvar:
CCSPlayer::m_angEyeAnglesCurrent armor points (0-100)Netvar:
CCSPlayer::m_ArmorValueWhether player has heavy armor equippedNetvar:
CCSPlayer::m_bHasHeavyArmorWhether player has a helmetNetvar:
CCSPlayer::m_bHasHelmetWhether player is scoped with a sniper rifleNetvar:
CCSPlayer::m_bIsScopedTarget yaw for the lower body animationNetvar:
CCSPlayer::m_flLowerBodyYawTargetMaximum alpha value for flashbang effectNetvar:
CCSPlayer::m_flFlashMaxAlphaPlayer’s money/account balanceNetvar:
CCSPlayer::m_iAccountDuration of current flashbang effectNetvar:
CCSPlayer::m_flFlashDurationPlayer stamina levelNetvar:
CCSPlayer::m_flStaminaMethods
Checks if another player is an enemyParameters:
player- Player to check
true if the player is an enemyChecks if the player is aliveReturns:
true if player is aliveGets the player’s nameReturns: Player name as string
Updates client-side animations for the player
Sets the local view angles for the playerParameters:
view_angles- New view angles to set
Usage Examples
Check player visibility
Recoil compensation
Movement state detection
The inheritance chain
c_cs_player → c_base_player → c_base_combat_character → c_base_animating → c_base_entity means that c_cs_player has access to all methods and properties from parent classes.