Raised This Month: $32 Target: $400
 8% 

[CSGO] Is there any easy way to get the winner of a match?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ryan2
Senior Member
Join Date: Jul 2020
Old 02-21-2021 , 12:36   [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #1

I am looking for a way to easily log the winner of a match into a database.

Is there any easy way to do this or a plugin for it?
Ryan2 is offline
Sarrus
Member
Join Date: May 2020
Location: France
Old 02-22-2021 , 12:10   Re: [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #2

Quote:
Originally Posted by Ryan2 View Post
I am looking for a way to easily log the winner of a match into a database.

Is there any easy way to do this or a plugin for it?
When you say winner, do you mean the winning team or the winning player in deathmatch mode?

You could combine this with this event in a plugin to get what you want
__________________
Discord Coding Server | Steam Profile | Community Website | Github Profile

Taking paid requests (add me on Discord)
Sarrus is offline
Ryan2
Senior Member
Join Date: Jul 2020
Old 02-22-2021 , 12:39   Re: [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #3

Quote:
Originally Posted by Sarrus View Post
When you say winner, do you mean the winning team or the winning player in deathmatch mode?

You could combine this with this event in a plugin to get what you want
Winner in general for any mode. I was hoping there would already be a simple plugin for it. I'll look into having someone create one for me I guess if I can't find an alternative.
Ryan2 is offline
Sarrus
Member
Join Date: May 2020
Location: France
Old 02-22-2021 , 15:03   Re: [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #4

Quote:
Originally Posted by Ryan2 View Post
Winner in general for any mode. I was hoping there would already be a simple plugin for it. I'll look into having someone create one for me I guess if I can't find an alternative.
Hmm, I'm not sure but I don't think there is such thing as a winner for CS:GO in competitive/casual mode, it's either the T side or the CT side that wins. Of course, you can define a winner yourself like the person with the most kills, the best K/D etc
__________________
Discord Coding Server | Steam Profile | Community Website | Github Profile

Taking paid requests (add me on Discord)
Sarrus is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-23-2021 , 05:12   Re: [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #5

PHP Code:
#include <sourcemod>
#include <cstrike>

public void OnPluginStart()
{
    
HookEvent("game_end"Event_GameEnd);
}

public 
void Event_GameEnd(Event event, const char[] namebool dontBroadcast
{    
    
int winner event.GetInt("winner");
    
LogMessage("match winner %d"winner);

__________________
Ilusion9 is offline
Ryan2
Senior Member
Join Date: Jul 2020
Old 02-23-2021 , 13:29   Re: [CSGO] Is there any easy way to get the winner of a match?
Reply With Quote #6

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
#include <sourcemod>
#include <cstrike>

public void OnPluginStart()
{
    
HookEvent("game_end"Event_GameEnd);
}

public 
void Event_GameEnd(Event event, const char[] namebool dontBroadcast
{    
    
int winner event.GetInt("winner");
    
LogMessage("match winner %d"winner);

As a noob I tried to figure this out but can't. I turned your code into a .sp file and complied into .smx and put it into plugins folder but I do not see any log output. I may be doing this completely wrong though
Ryan2 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode