TF2 - Player class id / name?
Posted: Sat Mar 31, 2018 5:27 pm
Theres a few things id like to be able to do with players that requires me to know what class they're playing.
As far as i can tell, Player does not have a tf2 class property or any way to find that?
Edit:
I found this: https://github.com/alliedmodders/source ... s.inc#L383
This code here can actually get and set class.
Is it possible to have this be part of the player object in a more convienant form, or even make a tf2player subclass?
As far as i can tell, Player does not have a tf2 class property or any way to find that?
Edit:
I found this: https://github.com/alliedmodders/source ... s.inc#L383
This code here can actually get and set class.
Syntax: Select all
def set_class(self, classid):
self.set_property_uchar('m_Shared.m_iDesiredPlayerClass', classid)
def get_class(self):
return self.get_property_uchar('m_PlayerClass.m_iClass')
Is it possible to have this be part of the player object in a more convienant form, or even make a tf2player subclass?