Difference between revisions of "CBasePlayer (CS)"

From AlliedModders Wiki
Jump to: navigation, search
m (Missing closing Table token)
 
(3 intermediate revisions by 2 users not shown)
Line 21: Line 21:
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| See that is shared between client & server for shared weapons code.
 
| See that is shared between client & server for shared weapons code.
 +
|- class="t2td"
 +
| Unknown
 +
| style="text-align:center" | 97
 +
| style="text-align:center" | 102
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | Unknown
 +
| Unknown
 +
|- class="t2td"
 +
| m_hSpecTarget
 +
| style="text-align:center" | 98
 +
| style="text-align:center" | 103
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | Unknown
 +
| Not sure, maybe last spectated
 +
|- class="t2td"
 +
| Unknown
 +
| style="text-align:center" | -
 +
| style="text-align:center" | -
 +
| style="text-align:center" | -
 +
| style="text-align:center" | -
 +
| EHANDLE takes place of 2 int, so nothing else here than previous data
 +
|- class="t2td"
 +
| m_flNextSpecButtonTime
 +
| style="text-align:center" | 100
 +
| style="text-align:center" | 105
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
| Next gametime pressing a button will take effect when spectating.
 +
|- class="t2td"
 +
| m_iSpectatedPlayerWeaponId
 +
| style="text-align:center" | 101
 +
| style="text-align:center" | 106
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| weapon type ( CSW_ ) the spectated player is holding
 +
|- class="t2td"
 +
| m_fHasSpectatedPlayerC4
 +
| style="text-align:center" | 102
 +
| style="text-align:center" | 107
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
|
 +
|- class="t2td"
 +
| m_fHasSpectatedPlayerDefuseKit
 +
| style="text-align:center" | 103
 +
| style="text-align:center" | 108
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| -
 +
|- class="t2td"
 +
| m_iObserverMode
 +
| style="text-align:center" | 104
 +
| style="text-align:center" | 109
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| enum {OBS_NONE = 0, OBS_CHASE_LOCKED, OBS_CHASE_FREE, OBS_ROAMING, OBS_IN_EYE, OBS_MAP_FREE, OBS_MAP_CHASE}
 +
|- class="t2td"
 +
| ?
 +
| style="text-align:center" | 105
 +
| style="text-align:center" | 110
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | ?
 +
| ?
 +
|- class="t2td"
 +
| ?
 +
| style="text-align:center" | 106
 +
| style="text-align:center" | 111
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | ?
 +
| ?
 +
|- class="t2td"
 +
| ?
 +
| style="text-align:center" | 107
 +
| style="text-align:center" | 112
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | ?
 +
| ?
 +
|- class="t2td"
 +
| m_flPainShock
 +
| style="text-align:center" | 108
 +
| style="text-align:center" | 113
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
| set to 0.3 or 1.0 when take damage, slows down player untill progressively reset to 0 by timers.
 +
|- class="t2td"
 +
| m_iLastZoom
 +
| style="text-align:center" | 109
 +
| style="text-align:center" | 114
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| Store zoomed value when player has just shot while zooming, so zoom can be restored
 +
|- class="t2td"
 +
| m_fResumeZoom
 +
| style="text-align:center" | 110
 +
| style="text-align:center" | 115
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | BOOL (int)
 +
| Wheter zoom has to be restored or not after a shot
 +
|- class="t2td"
 +
| m_flEjectBrass
 +
| style="text-align:center" | 111
 +
| style="text-align:center" | 116
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
|
 +
|- class="t2td"
 +
| m_iKevlarType
 +
| style="text-align:center" | 112
 +
| style="text-align:center" | 117
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| 0-No Kevlar , 1-Vest , 2-Vest+Helmet
 +
|- class="t2td"
 +
| m_fHasBeenKilledLastRound
 +
| style="text-align:center" | 113
 +
| style="text-align:center" | 118
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| Set to 1 if player has been killed last round, so game knows, for example, that default weapons has to be given.
 
|- class="t2td"
 
|- class="t2td"
 
| m_iPlayerTeam
 
| m_iPlayerTeam
Line 28: Line 147:
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Player team (0-NONE, 1-TT, 2-CT, 3-SPECTATOR, >3 Other teams)
 
| Player team (0-NONE, 1-TT, 2-CT, 3-SPECTATOR, >3 Other teams)
 +
|- class="t2td"
 +
| m_iAccount
 +
| style="text-align:center" | 115
 +
| style="text-align:center" | 120
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| Player money amount
 +
|- class="t2td"
 +
| m_fHasPrimary
 +
| style="text-align:center" | 116
 +
| style="text-align:center" | 121
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | int
 +
| If set to 1, player can't pickup an armoury entity holding a primary weapon, may be used to check for shield pickup
 
|- class="t2td"
 
|- class="t2td"
 
| m_iDefaultItems
 
| m_iDefaultItems
Line 42: Line 175:
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Join state for player (value of 5 will put the player in-game, other value will put the player on trigger_camera)
 
| Join state for player (value of 5 will put the player in-game, other value will put the player on trigger_camera)
 +
|- class="t2td"
 +
| m_pLastCamera
 +
| style="text-align:center" | 122
 +
| style="text-align:center" | 127
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | CBaseEntity*
 +
| use get_pdata_cbase
 +
|- class="t2td"
 +
| m_flNextCameraTime
 +
| style="text-align:center" | 123
 +
| style="text-align:center" | 128
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
| -
 +
|- class="t2td"
 +
| m_flNextCameraTime
 +
| style="text-align:center" | 122
 +
| style="text-align:center" | 127
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
| -
 +
|- class="t2td"
 +
| m_flLastActivityTime
 +
| style="text-align:center" | 124
 +
| style="text-align:center" | 129
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | float
 +
| -
 +
|- class="t2td"
 +
| m_bHasBeenShownBriefing
 +
| style="text-align:center" | 125
 +
| style="text-align:center" | 130
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | bool
 +
| Use get_pdata_int(playerIndex, m_bHasBeenShownBriefing) & (1<<0)
 +
|- class="t2td"
 +
| m_bHasChangeTeamThisRound
 +
| style="text-align:center" | 125
 +
| style="text-align:center" | 130
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | bool
 +
| -Use get_pdata_int(playerIndex, m_bHasChangeTeamThisRound) & 1<<8
 +
|- class="t2td"
 +
| m_iInternalModel
 +
| style="text-align:center" | 126
 +
| style="text-align:center" | 131
 +
| style="text-align:center" | +5
 +
| style="text-align:center" | inf
 +
| see cstrike.inc
 
|- class="t2td"
 
|- class="t2td"
 
| m_iPlayerSound
 
| m_iPlayerSound
Line 485: Line 667:
 
| Client's known FOV.
 
| Client's known FOV.
 
|- class="t2td"
 
|- class="t2td"
| m_rgpPlayerItems
+
| m_iNumRespawns
 
| style="text-align:center" | 365
 
| style="text-align:center" | 365
 
| style="text-align:center" | 370
 
| style="text-align:center" | 370
 
| style="text-align:center" | +5
 
| style="text-align:center" | +5
| style="text-align:center" | CBasePlayerItem*[MAX_ITEM_TYPES]
+
| style="text-align:center" | int
| (get_pdata_cbase)
+
|  
<pawn>
 
#define MAX_ITEM_TYPES 4
 
</pawn>
 
 
|- class="t2td"
 
|- class="t2td"
| m_pLastPrimaryItem
+
| m_pentRemoveOnDisconnect
| style="text-align:center" | 368
+
| style="text-align:center" | 366
| style="text-align:center" | 373
 
| style="text-align:center" | +5
 
| style="text-align:center" | CBasePlayerItem*
 
| (get_pdata_cbase)
 
|- class="t2td"
 
| m_pLastSecondaryItem
 
| style="text-align:center" | 369
 
| style="text-align:center" | 374
 
| style="text-align:center" | +5
 
| style="text-align:center" | CBasePlayerItem*
 
| (get_pdata_cbase)
 
|- class="t2td"
 
| m_pLastKnifeItem
 
 
| style="text-align:center" | 370
 
| style="text-align:center" | 370
| style="text-align:center" | 375
 
 
| style="text-align:center" | +5
 
| style="text-align:center" | +5
| style="text-align:center" | CBasePlayerItem*
+
| style="text-align:center" | int
| (get_pdata_cbase)
+
| Not really used in CS. If you set an entity in this offset, when a player disconnects this entity will be removed.
 +
Needs a better name.
 
|- class="t2td"
 
|- class="t2td"
| m_pLastGrenadeItem
+
| m_rgpPlayerItems
| style="text-align:center" | 371
+
| style="text-align:center" | 367
| style="text-align:center" | 376
 
| style="text-align:center" | +5
 
| style="text-align:center" | CBasePlayerItem*
 
| (get_pdata_cbase)
 
|- class="t2td"
 
| m_pLastC4Item
 
 
| style="text-align:center" | 372
 
| style="text-align:center" | 372
| style="text-align:center" | 377
 
 
| style="text-align:center" | +5
 
| style="text-align:center" | +5
| style="text-align:center" | CBasePlayerItem*
+
| style="text-align:center" | CBasePlayerItem*[MAX_ITEM_TYPES]
 
| (get_pdata_cbase)
 
| (get_pdata_cbase)
 +
<pawn>
 +
#define MAX_ITEM_TYPES 6
 +
</pawn>
 
|- class="t2td"
 
|- class="t2td"
 
| m_pActiveItem
 
| m_pActiveItem
Line 711: Line 873:
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Last _vgui_menus value of userinfo for this player
 
| Last _vgui_menus value of userinfo for this player
 +
|}

Latest revision as of 15:47, 28 September 2021



W = Windows | L = Linux

Name W. Offset L. Offset L. Diff Type Description
random_seed 96 101 +5 int See that is shared between client & server for shared weapons code.
Unknown 97 102 +5 Unknown Unknown
m_hSpecTarget 98 103 +5 Unknown Not sure, maybe last spectated
Unknown - - - - EHANDLE takes place of 2 int, so nothing else here than previous data
m_flNextSpecButtonTime 100 105 +5 float Next gametime pressing a button will take effect when spectating.
m_iSpectatedPlayerWeaponId 101 106 +5 int weapon type ( CSW_ ) the spectated player is holding
m_fHasSpectatedPlayerC4 102 107 +5 int
m_fHasSpectatedPlayerDefuseKit 103 108 +5 int -
m_iObserverMode 104 109 +5 int enum {OBS_NONE = 0, OBS_CHASE_LOCKED, OBS_CHASE_FREE, OBS_ROAMING, OBS_IN_EYE, OBS_MAP_FREE, OBS_MAP_CHASE}
? 105 110 +5 ? ?
? 106 111 +5 ? ?
? 107 112 +5 ? ?
m_flPainShock 108 113 +5 float set to 0.3 or 1.0 when take damage, slows down player untill progressively reset to 0 by timers.
m_iLastZoom 109 114 +5 int Store zoomed value when player has just shot while zooming, so zoom can be restored
m_fResumeZoom 110 115 +5 BOOL (int) Wheter zoom has to be restored or not after a shot
m_flEjectBrass 111 116 +5 float
m_iKevlarType 112 117 +5 int 0-No Kevlar , 1-Vest , 2-Vest+Helmet
m_fHasBeenKilledLastRound 113 118 +5 int Set to 1 if player has been killed last round, so game knows, for example, that default weapons has to be given.
m_iPlayerTeam 114 119 +5 int Player team (0-NONE, 1-TT, 2-CT, 3-SPECTATOR, >3 Other teams)
m_iAccount 115 120 +5 int Player money amount
m_fHasPrimary 116 121 +5 int If set to 1, player can't pickup an armoury entity holding a primary weapon, may be used to check for shield pickup
m_iDefaultItems 120 125 +5 int Default items (knife, gun) given: 1<<0 => Already given
m_iJoinedState 121 126 +5 int Join state for player (value of 5 will put the player in-game, other value will put the player on trigger_camera)
m_pLastCamera 122 127 +5 CBaseEntity* use get_pdata_cbase
m_flNextCameraTime 123 128 +5 float -
m_flNextCameraTime 122 127 +5 float -
m_flLastActivityTime 124 129 +5 float -
m_bHasBeenShownBriefing 125 130 +5 bool Use get_pdata_int(playerIndex, m_bHasBeenShownBriefing) & (1<<0)
m_bHasChangeTeamThisRound 125 130 +5 bool -Use get_pdata_int(playerIndex, m_bHasChangeTeamThisRound) & 1<<8
m_iInternalModel 126 131 +5 inf see cstrike.inc
m_iPlayerSound 237 242 +5 int The index of the sound list slot reserved for this player.
m_iTargetVolume 238 243 +5 int Ideal sound volume.
m_iWeaponVolume 239 244 +5 int How loud the player's weapon is right now.
m_iExtraSoundTypes 240 245 +5 int Additional classification for this weapon's sound.
m_iWeaponFlash 241 246 +5 int Brightness of the weapon flash.
m_flStopExtraSoundTime 242 247 +5 float None.
m_flFlashLightTime 243 248 +5 float Time until next battery draw/Recharge.
m_iFlashBattery 244 249 +5 int Flashlight Battery Draw.
m_afButtonLast 245 250 +5 int None.
m_afButtonPressed 246 251 +5 int None.
m_afButtonReleased 247 252 +5 int None.
m_pentSndLast 248 253 +5 edict_t* Last sound entity to modify player room type. ( get_pdata_ent() )
m_flSndRoomtype 249 254 +5 float Last roomtype set by sound entity.
m_flSndRange 250 255 +5 float Dist from player to sound entity.
m_flFallVelocity 251 256 +5 float Player's fall speed.
m_rgItems[item_antidote] 254 259 +5 int None.
m_rgItems[item_security] 255 260 +5 int None.
m_fKnownItem ? ? +5 int True when a new item needs to be added.
m_fNewAmmo ? ? +5 int True when a new item has been added.
m_afPhysicsFlags 257 263 +5 unsigned int Physics flags - set when 'normal' physics should be revisited or overriden.

The following masks can be found in player.h:

#define     PFLAG_ONLADDER      ( 1<<0 )
#define     PFLAG_ONSWING       ( 1<<0 )
#define     PFLAG_ONTRAIN       ( 1<<1 )
#define     PFLAG_ONBARNACLE    ( 1<<2 )
#define     PFLAG_DUCKING       ( 1<<3 )        // In the process of ducking, but totally squatted yet
#define     PFLAG_USING         ( 1<<4 )        // Using a continuous entity
#define     PFLAG_OBSERVER      ( 1<<5 )        // player is locked in stationary cam mode. Spectators can move, observers can't.
m_fNextSuicideTime 258 263 +5 float The time after which the player can next use the suicide command.
m_flTimeStepSound 259 264 +5 float When the last stepping sound was made.
m_flTimeWeaponIdle 260 265 +5 float When to play another weapon idle animation.
m_flSwimTime 261 266 +5 float How long player has been underwater.
m_flDuckTime 262 267 +5 float How long we've been ducking.
m_flWallJumpTime 263 268 +5 float How long until next walljump.
m_flSuitUpdate 264 269 +5 float When to play next suit update.
m_rgSuitPlayList 265 270 +5 int[CSUITPLAYLIST] Next sentencenum to play for suit update.
#define CSUITPLAYLIST	4  // max of 4 suit sentences queued up at any time
m_iSuitPlayNext 269 274 +5 int Next sentence slot for queue storage.
m_rgiSuitNoRepeat 270 275 +5 int[CSUITNOREPEAT] Suit sentence no repeat list.
#define CSUITNOREPEAT  32
m_rgflSuitNoRepeatTime 302 207 +5 int[CSUITNOREPEAT] How long to wait before allowing repeat.
m_lastDamageAmount 334 339 +5 int Last damage taken.
m_tbdPrev 335 340 +5 float Time-based damage timer.
m_flgeigerRange 336 341 +5 float Range to nearest radiation source.
m_flgeigerDelay 337 342 +5 float Delay per update of range msg to client.
m_igeigerRangePrev 338 343 +5 int None.
m_iStepLeft 339 344 +5 int Alternate left/right foot stepping sound.
m_szTextureName ? ? +5 char[CBTEXTURENAMEMAX] Current texture name we're standing on.
#define CBTEXTURENAMEMAX  13 // only load first n chars of name
m_chTextureType ? ? +5 char Current texture type.
#define CHAR_TEX_CONCRETE  'C'	// texture types
#define CHAR_TEX_METAL	   'M'
#define CHAR_TEX_DIRT	   'D'
#define CHAR_TEX_VENT	   'V'
#define CHAR_TEX_GRATE	   'G'
#define CHAR_TEX_TILE	   'T'
#define CHAR_TEX_SLOSH	   'S'
#define CHAR_TEX_WOOD	   'W'
#define CHAR_TEX_COMPUTER  'P'
#define CHAR_TEX_GLASS	   'Y'
#define CHAR_TEX_FLESH	   'F'
m_idrowndmg 345 350 +5 int Track drowning damage taken.
m_idrownrestored 346 351 +5 int Track drowning damage restored.
m_bitsHUDDamage 347 352 +5 int Damage bits for the current fame. These get sent to the hud via the Damage message.
// these are the damage types that have client hud art
#define DMG_SHOWNHUD ( DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK )
m_fInitHUD 348 353 +5 BOOL True when deferred HUD restart msg needs to be sent.
m_fInitHUD 349 354 +5 BOOL None.
m_iTrain 350 355 +5 int Train control position.
m_fWeapon 351 356 +5 BOOL Set this to FALSE to force a reset of the current weapon HUD info.
m_pTank ? ? +5 EHANDLE The tank which the player is currently controlling, NULL if no tank.
m_fDeadTime 354 359 +5 float the time at which the player died (used in PlayerDeathThink()).
m_fNoPlayerSound 355 360 +5 BOOL A debugging feature. Player makes no sound if this is true.
m_fLongJump 356 361 +5 BOOL Does this player have the longjump module?
m_tSneaking 357 362 +5 float None.
m_iUpdateTime 358 363 +5 int Stores the number of frame ticks before sending HUD update messages.
m_iClientHealth 359 364 +5 int The health currently known by the client. If this changes, send a new.
m_iClientBattery 360 365 +5 int The Battery currently known by the client. If this changes, send a new.
m_iHideHUD 361 366 +5 int The players hud weapon info is to be hidden
m_iClientHideHUD 362 367 +5 int None.
m_iFOV 363 368 +5 int Field of view.
m_iClientFOV 364 369 +5 int Client's known FOV.
m_iNumRespawns 365 370 +5 int
m_pentRemoveOnDisconnect 366 370 +5 int Not really used in CS. If you set an entity in this offset, when a player disconnects this entity will be removed.

Needs a better name.

m_rgpPlayerItems 367 372 +5 CBasePlayerItem*[MAX_ITEM_TYPES] (get_pdata_cbase)
#define MAX_ITEM_TYPES 6
m_pActiveItem 373 378 +5 CBasePlayerItem* (get_pdata_cbase)
m_pClientActiveItem 374 379 +5 CBasePlayerItem* Client version of the active item. (get_pdata_cbase)
m_pLastItem 375 380 +5 CBasePlayerItem* (get_pdata_cbase)
m_rgAmmo 376 381 +5 int[MAX_AMMO_SLOTS] Shared ammo slots.
#define MAX_AMMO_SLOTS  32  // not really slots
m_rgAmmoLast 408 413 +5 int[MAX_AMMO_SLOTS] Shared ammo slots.
m_vecAutoAim 440 445 +5 Vector Shared ammo slots.
m_fOnTarget 441 446 +5 BOOL Shared ammo slots.
m_iDeaths 442 447 +5 int Shared ammo slots.
m_iRespawnFrames 443 447 +5 float Used in PlayerDeathThink() to make sure players can always respawn.
m_izSBarState 446 451 +5 int[SBAR_END]
enum sbar_data
{
	SBAR_ID_TARGETNAME = 1,
	SBAR_ID_TARGETHEALTH,
	SBAR_ID_TARGETARMOR,
	SBAR_END,
};
m_flNextSBarUpdateTime 449 454 +5 float None.
m_flStatusBarDisappearDelay 450 455 +5 float None.
m_lastx 483 488 +5 int These are the previous update's crosshair angles.
m_lasty 484 489 +5 int These are the previous update's crosshair angles.
m_nCustomSprayFrames 485 490 +5 int Custom clan logo frames for this player.
m_flNextDecalTime 486 491 +5 float Next time this player can spray a decal.
m_szTeamName 487 492 +5 char[TEAM_NAME_LENGTH] None.
#define TEAM_NAME_LENGTH  16
m_szAnimExtention 492 497 +5 char[32] None.
m_SbarString0 ? ? +5 char[ SBAR_STRING_SIZE ]
#define SBAR_STRING_SIZE 128
m_SbarString1 ? ? +5 char[ SBAR_STRING_SIZE ] None.
m_flNextChatTime ? ? +5 float
#define CHAT_INTERVAL 1.0f
m_iClAutoWepSwitch 509 514 +5 int Last _cl_autowepswitch value of userinfo for this player
m_iVGUIMenus 510 515 +5 int Last _vgui_menus value of userinfo for this player