CBasePlayer: Difference between revisions
Jump to navigation
Jump to search
Bug:On the client, CBasePlayer is
No edit summary |
No edit summary |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{stub}} | {{stub}} | ||
''' | {{CD|CBasePlayer|file1=[https://github.com/ValveSoftware/source-sdk-2013/blob/master/src/game/server/player.cpp player.cpp ]}} | ||
'''<code>CBasePlayer</code>''' is the class from which all player classes should inherit. See also [[:Category:CBasePlayer]]. | |||
[[ | |||
{{bug|hidetested=1|On the client, CBasePlayer is <code>#define C_BasePlayer</code> so that shared code works. Unfortunately, Visual Studio's Intellisense system (prior to 2010, which fixes this) is confused by this and will apply the #def even when you are looking at the server: you'll keep getting sent to <code>C_BasePlayer</code> when looking up references, definitions, and so on. This issue doesn't affect the compiler, thankfully!}} | |||
==Mapping== | |||
Using ''trigger_'' brushes and ''!activator'', ''!player'', or ''!pvsplayer'' keywords, you can access player entities. Some of these functions can be called using input/output systems. | |||
==Server== | |||
===Functions=== | |||
This list is cursory and may be inaccurate: | |||
(see: [[player]] for properties and functions.) | |||
*Weapon selection | |||
*[[Viewmodel]] state | |||
*FOV (including zoom) | |||
*Eye position & smoothing | |||
*Current [[PVS]] (for network updates) | |||
*Flashlight state | |||
* '''DisableFlashlight''': Disables the player's flashlight. | |||
* '''EnableFlashlight''': Enables the player's flashlight. | |||
*Battery state (sprinting, flashight drain, oxygen supply...) | |||
*Ladder state | |||
*Hint system | |||
*Respawn state | |||
*Connection state | |||
*Receiving & managing [[usercmd]]s (<code>[[CPlayerMove]]</code> executes) | |||
*Some [[prediction]] setup | |||
*CreatePlayer (called from [[Game initialization|<game>_client]]) | |||
*Autokick enabled/disabled | |||
*Player name, chat, team & serverID | |||
*Spectator system | |||
*[[Bot]] plug-in support | |||
*Client-to-server console commands | |||
*MP tonemap Hammer input (new addition, available in SDK but has yet to roll out to Valve's own games) | |||
*Armour amount | |||
*Score, kills, deaths | |||
*Suicide | |||
*Time-based damage (drowning, fire...) | |||
*[[VPhysics]] shadow | |||
*Special [[QPhysics]] movement code | |||
*"Player-simulated entities" | |||
*Auto-aim | |||
*HEV suit (vox, Geiger counter) | |||
*HUD updates (inc. damage received) | |||
*Using/picking up objects | |||
*Vehicle interaction | |||
*"Replay mode" | |||
*Footsteps | |||
*Gamepad rumble | |||
*Debug overlays | |||
*Level [[fog]] | |||
===Related classes=== | |||
*<code>[[CBaseCombatCharacter]]</code> (base class) | |||
*<code>[[CBotManager]]</code> (friend class) | |||
*<code>[[CPlayerMove]]</code> | |||
*<code>[[CUserCmd]]</code> | |||
*<code>[[CPlayerInfo]]</code> | |||
*<code>[[CPlayerCmdInfo]]</code> | |||
*<code>[[CPlayerSimInfo]]</code> | |||
*<code>[[CCommandContext]]</code> | |||
*<code>[[CBloodSplat]]</code> | |||
==Client== | |||
... | |||
==See also== | |||
* [[CBaseMultiplayerPlayer]] - Multiplayer-oriented player base class. | |||
[[Category:Classes|B]] | |||
[[Category:CBasePlayer|!]] |
Latest revision as of 12:30, 26 May 2025
![]() |
---|
CBasePlayer |
![]() |
CBasePlayer
is the class from which all player classes should inherit. See also Category:CBasePlayer.

#define C_BasePlayer
so that shared code works. Unfortunately, Visual Studio's Intellisense system (prior to 2010, which fixes this) is confused by this and will apply the #def even when you are looking at the server: you'll keep getting sent to C_BasePlayer
when looking up references, definitions, and so on. This issue doesn't affect the compiler, thankfully!Mapping
Using trigger_ brushes and !activator, !player, or !pvsplayer keywords, you can access player entities. Some of these functions can be called using input/output systems.
Server
Functions
This list is cursory and may be inaccurate: (see: player for properties and functions.)
- Weapon selection
- Viewmodel state
- FOV (including zoom)
- Eye position & smoothing
- Current PVS (for network updates)
- Flashlight state
* DisableFlashlight: Disables the player's flashlight. * EnableFlashlight: Enables the player's flashlight.
- Battery state (sprinting, flashight drain, oxygen supply...)
- Ladder state
- Hint system
- Respawn state
- Connection state
- Receiving & managing usercmds (
CPlayerMove
executes) - Some prediction setup
- CreatePlayer (called from <game>_client)
- Autokick enabled/disabled
- Player name, chat, team & serverID
- Spectator system
- Bot plug-in support
- Client-to-server console commands
- MP tonemap Hammer input (new addition, available in SDK but has yet to roll out to Valve's own games)
- Armour amount
- Score, kills, deaths
- Suicide
- Time-based damage (drowning, fire...)
- VPhysics shadow
- Special QPhysics movement code
- "Player-simulated entities"
- Auto-aim
- HEV suit (vox, Geiger counter)
- HUD updates (inc. damage received)
- Using/picking up objects
- Vehicle interaction
- "Replay mode"
- Footsteps
- Gamepad rumble
- Debug overlays
- Level fog
Related classes
CBaseCombatCharacter
(base class)CBotManager
(friend class)CPlayerMove
CUserCmd
CPlayerInfo
CPlayerCmdInfo
CPlayerSimInfo
CCommandContext
CBloodSplat
Client
...
See also
- CBaseMultiplayerPlayer - Multiplayer-oriented player base class.