found a problem while setting the team score. It seems to work but it will reset after the end of the next round. I wanted to have this to be able to switch teams after 50% of the rounds are over.
This is what I came up with
Code: Select all
def set_team_score(self, team, score):
for entity in EntityIter('cs_team_manager'):
if entity.team != team:
continue
# set score
entity.score = score
# set rounds won
entity.rounds_won = score
Thought that setting "rounds_won" additionally would fix the behaviour, but it doesn't. Sourcemod seems to have a function to set the team score without resetting it afterwards. Haven't found any clue on this forums nor in the wiki. Which doesn't mean I have found everything I could have :)
According to the definition I have found the above source code sets
Code: Select all
[score]
prop = "CTeam.m_iScore"
type = "int"
[rounds_won]
prop = "CTeam.m_RoundsWon"
type = "int"
I don't know whether this is the correct place at all to actually make the change or if it is only for reading the data.