CSGO: Change team score
CSGO: Change team score
Is it possible to change team score in csgo game?
Yes, am pretty sure it is possible. I do not have time to test, so the following might not work. There are actually 3 different properties for the score:
- m_scoreTotal - <BaseEntity>.score_total
- m_scoreFirstHalf - <BaseEntity>.score_first_half
- m_scoreSecondHalf - <BaseEntity>.score_second_half
Syntax: Select all
from filters.entity import EntityIter
def set_team_score(team, score):
for entity in EntityIter('cs_team_manager', return_types='entity'):
if entity.team != team:
continue
entity.score_total = score
As I understand entity it doesn't have score_total. I have print dir object:
Syntax: Select all
def set_team_score(team, score):
for entity in EntityIter('cs_team_manager', return_types='entity'):
if entity.team != team:
continue
print(dir(entity))
entity.score_total = score
Syntax: Select all
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_edict', '_entities', '_get_function', '_get_offset', '_get_property', '_get_virtual', '_index', '_set_offset', '_set_property', 'basehandle', 'classname', 'color', 'damage', 'datamaps', 'edict', 'entities', 'functions', 'get_color', 'index', 'instances', 'inthandle', 'named_datamaps', 'offsets', 'pointer', 'properties', 'set_color', 'virtuals']
AttributeError: Attribute 'score_total' not found
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Which version are you using? __dir__ has been added to the entities_changes branch to also print out the dynamically supported attributes, but using dir() in the current release does not show those. It also seems that the data is not properly defined for those dynamic properties, so it makes sense it encounters an attribute error. Try using those properties by name instead, along with entity.set_prop_int and see if that works.
I just remembered that we passed in entity types to BaseEntity in the old version. So, the code should look more like:
However, I think we are really close to finishing the entities_changes updates, so you will have to update the code at that time.
Syntax: Select all
def set_team_score(team, score):
for index in EntityIter('cs_team_manager'):
entity = BaseEntity(index, 'team')
if entity.team != team:
continue
entity.score_total = score
However, I think we are really close to finishing the entities_changes updates, so you will have to update the code at that time.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 93 guests