CBasePlayerItem

Player item base class

Type: Reference type

Methods

Declaration Description
CBaseAnimating@ opImplCast() Implicitly casts to base type.
CBaseDelay@ opImplCast() Implicitly casts to base type.
CBaseEntity@ opImplCast() Implicitly casts to base type.
const Vector& GetOrigin() const Gets the entity's (absolute) origin.
void SetOrigin(const Vector& in vecOrigin) Sets this entity's (absolute) origin
bool KeyValue(const string& in szKeyName, const string& in szValue) Sets keyvalue data on this entity
void TraceAttack(entvars_t@ pevAttacker, float flDamage, const Vector& in vecDir, TraceResult& in traceResult, int bitsDamageType) Traces an attack by the given entity to this entity.
void TraceBleed(float flDamage, const Vector& in vecDir, TraceResult& in traceResult, int bitsDamageType) Traces entity bleed event.
int GiveAmmo(int iAmount, const string& in szName, int iMax, const bool fFromWeapon = true) Gives ammo to this entity.
bool HasTarget(const string& in szTarget) Returns whether this entity has the given target.
string TeamID() Returns this entity's team ID.
string GetClassname() const Returns this entity's class name.
string GetTargetname() const Returns this entity's target name.
bool FVisibleFromPos(const Vector& in vecTarget, const Vector& in vecStart) Returns whether this entity is visible from the given position.
string SOUNDREPLACEMENT_Find(const string& in szFilename) Find sound replacement for the given file.
int FindMonstersInWorld(array<CBaseEntity@>@ pArray, int flagMask) Finds monsters in the world
bool IsPlayerAlly() const Returns whether this entity is allied to players.
void SetPlayerAlly(bool fState) Sets this entity's player ally status.
void SetPlayerAllyDirect(bool fState) Sets this entity's player ally status.
Use this only if you need the setting to be exactly what you give it (e.g. when copying from another monster)
bool opEquals(CBaseEntity@ pOther) Compares 2 entities for equality.
void Precache() Precaches the entity. Do not call directly.
int ObjectCaps() Gets this entity's objects caps. See the FCAP enum.
void SetObjectCollisionBox() Sets up the object collision box.
int GetClassification(int cl) Gets this entity's classification. Returns the given value if none is set. See the CLASSIFICATION enum.
const string& GetClassificationTag() Gets this entity's classification tag.
const string& GetClassificationName() Gets this entity's classification name.
void SetClassification(int cl) Sets this entity's classification override. Can override the entity's player ally setting.
void SetClassificationFromEntity(CBaseEntity@ pEntity) Sets this entity's classification override to the classification override set on the given entity. Can override the entity's player ally setting.
void ClearClassification() Clears this entity's classification override.
int IRelationship(CBaseEntity@ other, bool ignoreNoTarget = false) Gets the relationship between this entity and the given entity. See the RELATIONSHIP enum.
int IRelationshipByClass(CLASS iClass) Gets the relationship between this entity and the given entity classification. See the RELATIONSHIP enum.
int Classify() Gets this entity's classification.
int TakeDamage(entvars_t@ pevInflictor, entvars_t@ pevAttacker, float flDamage, int bitsDamageType) Causes this entity to take damage. Returns 1 if it took damage, 0 otherwise.
bool TakeHealth(float flHealth, int bitsDamageType, int health_cap = 0) Takes health from this entity. Note: flHealth is added to entity health. Use negative values to subtract.If health_cap is non-zero, won't add more than health_cap. Returns true if it took damage, false otherwise.
bool TakeArmor(float flArmor, int bitsDamageType, int armor_cap = 0) Takes armor from this entity. Note: flArmor is added to entity armor. Use negative values to subtract.If armor_cap is non-zero, won't add more than armor_cap. Returns 1 if it took damage, 0 otherwise.
void Killed(entvars_t@pevAtttacker, int iGibbed) Tells this entity it's been killed. See the GIB enum for possible values.
int BloodColor() Returns the blood color. See the BLOOD_COLOR enum.
bool IsTriggered(CBaseEntity@ pActivator) Returns whether this entity is triggered by the given entity.
CBaseMonster@ MyMonsterPointer() Returns this entity as its monster entity, if it is a monster.
CustomKeyvalues@ GetCustomKeyvalues() Gets this entity's custom keyvalues.
bool BlockedByEntity(CBaseEntity@ pOther, float flDamage) Returns true if you should be blocked by the entity, false otherwise. Also deals blocking damage to the entity, if applicable.
void SUB_Remove() Think function. Delay-removes this entity.
void SUB_DoNothing() Think function. Explicitly does nothing.
void SUB_StartFadeOut() Think function. Starts fading this entity.
void SUB_FadeOut() Think function. Fades this entity.
void SUB_CallUseToggle() Think function. Calls use toggle on this entity.
bool ShouldToggle(USE_TYPE useType, const bool currentState) Returns whether this entity should toggle.
void FireBullets(uint cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread,float flDistance, Bullet iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t@ pevAttacker = null, FireBulletsDrawMode fDraw = FBDM_DRAW) Fires bullets. Must call CMath::MakeAimVectors with an angle vector first.
bool Intersects(CBaseEntity@ pOther) Returns whether this entity intersects with the given entity.
void MakeDormant() Makes this entity dormant.
bool IsDormant() Returns whether this entity is dormant.
bool IsLockedByMaster() Returns whether this entity is locked by its master.
edict_t@ edict() Returns this entity's edict.
int entindex() Returns this entity's index.
bool SetupModel() Sets up the model.
int GetToggleState() Gets the toggle state.
See the TOGGLE_STATE enum.
void AddPoints(int score, const bool bAllowNegativeScore) Adds points to this entity.
void AddPointsToTeam(int score, const bool bAllowNegativeScore) Adds points to this entity's team.
AddPlayerItemResult AddPlayerItem(CBasePlayerItem@ pItem) Adds the given player item to this entity.
bool RemovePlayerItem(CBasePlayerItem@ pItem) Removes the given player item to this entity.
float GetDelay() Gets this entity's trigger delay.
bool IsMoving() Returns whether this entity is moving.
void OverrideReset() Resets this entity.
int DamageDecal(int bitsDamageType) Returns the damage decal
See decal_e.
void SetToggleState(int state) Sets this entity's toggle state.
void StartSneaking() Starts sneaking.
void StopSneaking() Stops sneaking.
bool OnControls(entvars_t@ pev) Reacts to controls set on the pev.
bool IsSneaking() Returns whether this entity is sneaking.
bool IsAlive() Returns whether this entity is alive.
bool IsBSPModel() Returns whether this entity is a BSP model.
bool ReflectGauss() Returns whether this entity reflects gauss shots.
bool IsInWorld() Returns whether this entity is in the world.
bool IsMonster() Returns whether this entity is a monster.
bool IsPlayer() Returns whether this entity is a player.
bool IsNetClient() Returns whether this is a net client.
bool IsPointEnt() Returns whether this is a point entity.
bool IsBreakable() Returns whether this is a breakable brush entity.
bool IsMachine() Returns whether this is a machine.
bool CriticalRemove() Removes this entity in critical situations.
CBaseEntity@ GetNextTarget() Gets the next target to trigger.
void Think() Makes this entity think. Do not call directly.
void Touch(CBaseEntity@ pOther) Triggers this entity's touch function.
void Use(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue = 0.0f) Trigger's this entity's use function.
void Blocked(CBaseEntity@ pOther) Triggers this entity's blocked function.
void UpdateOnRemove() Updates this entity when removed.
CBaseEntity@ Respawn() Respawns this entity.
bool FBecomeProne(CBaseEntity@ pOther) Makes this entity become prone.
Vector Center() Returns this entity's center.
Vector EyePosition() Returns this entity's eye position.
Vector EarPosition() Returns this entity's ear position.
Vector BodyTarget(const Vector& in posSrc) Returns this entity's body target for shooting.
int Illumination() Returns this entity's illumination.
bool FVisible(CBaseEntity@ pEntity, bool fIgnoreGlass) Returns whether this entity is visible to the given entity.
bool FVisible(const Vector& in vecOrigin) Returns whether this entity is visible from the given origin.
bool IsFacing(entvars_t@ pevTest, float flDotProduct = VIEW_FIELD_ULTRA_NARROW) Returns whether this entity is facing the given entity, within the given view field.
float GetPointsForDamage(float flDamage) Returns the points received for damage done.
void GetDamagePoints(entvars_t@ pevAttacker, entvars_t@ pevInflictor, float flDamage) Adds damage points to the inflicting entity.
void OnCreate() Entity constructor.
void OnDestroy() Entity destructor.
bool IsRevivable() Returns whether this entity is revivable at this time.
void BeginRevive(float flTimeUntilRevive) Prepares this entity for revival. flTimeUntilRevive is the time until the revive action completes.
void EndRevive(float flTimeUntilRevive) Called when this entity should be revived. flTimeUntilRevive is the time until the revival should start.
dictionary@ GetUserData() Gets the user data on this entity. Do not keep references to this data, the object might be removed from this entity.
Only map scripts can use this.
dictionaryValue& GetUserData(const string& in szKey) Gets the user data stored under the specified key on this entity.
Do not keep references to this data, the object might be removed from this entity.
Only map scripts can use this.
void ClearUserData() Clears the user data on this entity. WARNING: clears all data.
Only map scripts can use this.
void SUB_UseTargets(CBaseEntity@ pActivator, USE_TYPE useType, float flValue) Causes this entity to trigger its targets with an optional delay.
void DelayThink() Think function. Used internally.
float StudioFrameAdvance(float flInterval = 0.0f) Accumulate animation frame time from last time called until now.
int GetSequenceFlags() Get sequence flags.
int LookupActivity(int iActivity) Returns the index of the given activity, or -1 if no such activity exists.
int LookupActivityHeaviest(int iActivity) Returns the index of the given activity that has the heaviest weight, or -1 if no such activity exists.
int LookupSequence(const string& in szLabel) Returns the index of the given sequence, or -1 if no such sequence exists.
void ResetSequenceInfo() Resets sequence info.
void ResetGaitSequenceInfo() Resets gait sequence info.
void DispatchAnimEvents(float flFutureInterval = 0.1f) Handle events that have happend since last time called up until X seconds into the future.
float SetBoneController(int iController, float flValue) Sets the specified bone controller to the given value.
void InitBoneControllers() Initializes bone controllers.
float SetBlending(int iBlender, float flValue) Sets the given blending controller to the given value.
void GetBonePosition(int iBone, Vector& out origin, Vector& out angles) Gets the position of the given bone.
void GetAutomovement(Vector& out origin, Vector& out angles, float flInterval = 0.1f) Gets automatic movement.
int FindTransition(int iEndingSequence, int iGoalSequence, int& out iDir) Find the transition between 2 sequences.
int FindTransition(int iEndingSequence, int iGoalSequence) Find the transition between 2 sequences.
void GetAttachment(int iAttachment, Vector& out origin, Vector& out angles) Gets the attachment position.
void SetBodygroup(int iGroup, int iValue) Sets the given body group to the given value.
int GetBodygroup(int iGroup) Gets the value of the given body group.
bool ExtractBbox(int iSequence, Vector& out mins, Vector& out maxs) Extracts the bounding box of the current model.
int GetAttachmentCount() Gets the number of attachments that the current model has.
void SetSequenceBox() Sets the sequence box.
int GetSequenceActivityName(int iSequence) Gets activity for the given sequence.
bool AddToPlayer(CBasePlayer@ pPlayer) Returns true if this item wants itself added to the player's inventory.
bool AddDuplicate(CBasePlayerItem@ pItem) returns true if this item wants the duplicate removed from the world.
void DestroyItem() Think function. Destroys this item.
void Collect(CBaseEntity@ pOther) Attempts to let pOther collect this item.
void DefaultTouch(CBaseEntity@ pOther) Touch function. Default touch.
void ItemUse(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue) Default weapon use function.
void FallThink() Think function. When an item is first spawned, this think is run to determine when the object has hit the ground.
void Materialize() Make a weapon visible and tangible.
void AttemptToMaterialize() Think function. The weapon desires to become visible and tangible, if the game rules allow for it.
CBasePlayerItem@ RespawnItem() Copy a weapon.
void FallInit() Fall init.
void CheckRespawn() Check respawn.
void GetItemInfo(ItemInfo& out info) Gets item info.
bool CanDeploy() Returns whether this item can deploy.
bool Deploy() Returns if deploy was successful.
bool CanHolster() Can this weapon be put away right now?
void Holster(int iSkipLocal = 0) Holsters this weapon.
void UpdateItemInfo() Updates item info.
void LoadSprites(CBasePlayer@ pPlayer, const string& in szName) Load item sprites.
void Kill() Kills this item.
void AttachToPlayer(CBasePlayer@ pPlayer) Attach this item to the given player.
int PrimaryAmmoIndex() Gets the primary ammo index, or -1 if this item doesn't use primary ammo.
int SecondaryAmmoIndex() Gets the secondary ammo index, or -1 if this item doesn't use secondary ammo.
bool UpdateClientData(CBasePlayer@ pPlayer) Updates client data.
CBasePlayerWeapon@ GetWeaponPtr() Gets this item as a weapon. Returns null if this is not a weapon.
int iItemSlot() Gets the slot this item is in. 0 to MAX_ITEMS_SLOTS.
int iItemPosition() Gets the item position.
string pszAmmo1() Gets the name of the primary ammo.
int iMaxAmmo1() Gets the primary ammo maximum.
string pszAmmo2() Gets the name of the secondary ammo.
int iMaxAmmo2() Gets the secondary ammo maximum.
string pszName() Gets the name of this item.
int iMaxClip() Gets the max clip amount.
int iWeight() Gets the item weight.
int iFlags() Gets the item flags.
float GetRespawnTime() const Gets this item's respawn time (time from pickup to respawn).
CBasePlayerItem@ DropItem() CBaseEntity to drop.
By default, this entity.
bool CanHaveDuplicates() Can this weapon have duplicates added?
CBasePlayerWeapon@ opCast() Explicitly casts to sub type.

Properties

Declaration Description
entvars_t@ pev Entity variables
bool m_fOverrideClass Whether this entity overrides the classification.
int m_iClassSelection The overridden classification.
float m_flMaximumFadeWait Maximum fade wait time.
float m_flMaximumFadeWaitB Maximum fade wait time B.
bool m_fCanFadeStart Whether fading can start.
bool m_fCustomModel Whether a custom model is used.
Vector m_vecLastOrigin Last origin vector
string_t targetnameOutFilterType Target name out filter type.
string_t classnameOutFilterType Class name out filter type.
string_t targetnameInFilterType Target name in filter type.
string_t classnameInFilterType Class name in filter type.
int m_iOriginalRenderMode Original render model.
int m_iOriginalRenderFX Original render FX.
float m_flOriginalRenderAmount Original render amount.
Vector m_vecOriginalRenderColor Original render color.
float m_flDelay Delay before fire.
string_t m_iszKillTarget The name of the kill target, if any.
float m_flFrameRate Computed FPS for current sequence.
float m_flGroundSpeed Computed linear movement rate for current sequence.
float m_flLastEventCheck Last time the event list was checked.
float m_flLastGaitEventCheck Last time the event list was checked.
bool m_fSequenceFinished Flag set when StudioAdvanceFrame moves across a frame boundry.
bool m_fSequenceLoops True if the sequence loops.
EHandle m_hPlayer The owning player. null if no owner.
EHandle m_hNextItem Gets the next item. null if no next item.
const int m_iId The item id.
float m_flLastBounce The last bounce time.
bool m_bExclusiveHold If set, as long as a player has this item, the player must keep this weapon selected.No more than one item with this set can be carried at one time.