Skip to content

Commit

Permalink
Added arms_model property to Player for CS:GO. (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
CookStar committed Nov 13, 2021
1 parent 02aaee6 commit 7c36038
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Expand Up @@ -77,6 +77,7 @@ srv_check = False

[property]

arms_model_name = m_szArmsModel
stamina = cslocaldata.m_flStamina
shots_fired = cslocaldata.m_iShotsFired
armor = m_ArmorValue
Expand Down
28 changes: 28 additions & 0 deletions addons/source-python/packages/source-python/players/engines/csgo/__init__.py 100644 → 100755
Expand Up @@ -11,6 +11,7 @@
# ConVars
from cvars import ConVar
# Engines
from engines.precache import Model
from engines.server import engine_server
# Entities
from entities.helpers import wrap_entity_mem_func
Expand Down Expand Up @@ -78,6 +79,33 @@ def _set_assists(self, value):
_get_assists, _set_assists,
doc="""The number of assists a player has.""")

def get_arms_model(self):
"""Return the player's arms model.
:return:
``None`` if the player has no arms model.
:rtype: Model
"""
arms_model_name = self.arms_model_name
if not arms_model_name:
return None

return Model(arms_model_name)

def set_arms_model(self, model):
"""Set the player's arms model to the given model.
:param Model model:
The model to set.
"""
self.arms_model_name = model.path

arms_model = property(
get_arms_model, set_arms_model,
doc="""Property to get/set the player's arms model.
.. seealso:: :meth:`get_arms_model` and :meth:`set_arms_model`""")

@_Player.godmode.getter
def godmode(self):
"""Return whether god mode is enabled.
Expand Down

0 comments on commit 7c36038

Please sign in to comment.