CSGO: update team score

Please post any questions about developing your plugin here. Please use the search function before posting!
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

CSGO: update team score

Postby nullable » Sat Apr 04, 2015 9:17 pm

After updating Source.Python (8 march 2015) the following code stopped working:

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


entity.team - every time result 0. Please help to resolve my problem.
User avatar
L'In20Cible
Project Leader
Posts: 1536
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Sat Apr 04, 2015 9:22 pm

User avatar
L'In20Cible
Project Leader
Posts: 1536
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Sat Apr 04, 2015 9:36 pm

Ayuto just tested and seems that the KeyValue retrieved using <CTeam>.team always returns zero. We will do the change but the following proved to works, for now:

Syntax: Select all

if entity.get_property_int('m_iTeamNum') != team:
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sun Apr 05, 2015 7:02 am

Syntax: Select all

entity.set_property_int('m_scoreTotal', team_score)
doesn't work correct. Because it not set team_score. Please help to resolve it.
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sun Apr 05, 2015 8:04 am

Thanks. The problem has been resolved.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 103 guests