Hi,
I looked over this link: https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events
And I couldn't find any event that triggers on the match end, the purpose on is to know which team has won the game.
Thanks in advance.
Match End Event?
Try this one:
http://wiki.sourcepython.com/pages/Event-csgo:cs_win_panel_match
You can check the team scores to know who won.
http://wiki.sourcepython.com/pages/Event-csgo:cs_win_panel_match
You can check the team scores to know who won.
satoon101 wrote:Try this one:
http://wiki.sourcepython.com/pages/Event-csgo:cs_win_panel_match
You can check the team scores to know who won.
Recording to https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events#cs_win_panel_match that event does have any info, how can I check the team who won then?
No, you can't iterate. You can iterate over the "variables" attribute of the GameEvent object (or just print it). Example: However, I just checked that in CS:GO and it does not have any event variables (only CS:S).
Syntax: Select all
from events import Event
@Event('cs_win_panel_match')
def cs_win_panel_match(event):
print(event.variables.as_dict())
Since there are no variables, you have to loop through the cs_team_manager entities:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/teams/csgo.ini
When looping through, check the team number of each to make sure it's 2 or 3, then check the score of the team:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/entities/csgo/CTeam.ini
If you have access to the server's console, you might set net_showevents to 2 and it will show you the events and their variables when they fire. Note that you need to either enable cheats or remove the cheat flag from net_showevents before setting it to 2.
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/teams/csgo.ini
When looping through, check the team number of each to make sure it's 2 or 3, then check the score of the team:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/data/source-python/entities/csgo/CTeam.ini
If you have access to the server's console, you might set net_showevents to 2 and it will show you the events and their variables when they fire. Note that you need to either enable cheats or remove the cheat flag from net_showevents before setting it to 2.
Ayuto wrote:No, you can't iterate. You can iterate over the "variables" attribute of the GameEvent object (or just print it). Example:However, I just checked that in CS:GO and it does not have any event variables (only CS:S).Syntax: Select all
from events import Event
@Event('cs_win_panel_match')
def cs_win_panel_match(event):
print(event.variables.as_dict())
Sorry, misinterpreted how you finally implemented it

Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 118 guests