AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   [CSGO] Is there any easy way to get the winner of a match? (https://forums.alliedmods.net/showthread.php?t=330791)

Ryan2 02-21-2021 12:36

[CSGO] Is there any easy way to get the winner of a match?
 
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?

Sarrus 02-22-2021 12:10

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

Originally Posted by Ryan2 (Post 2737723)
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

Ryan2 02-22-2021 12:39

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

Originally Posted by Sarrus (Post 2737849)
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.

Sarrus 02-22-2021 15:03

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

Originally Posted by Ryan2 (Post 2737853)
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

Ilusion9 02-23-2021 05:12

Re: [CSGO] Is there any easy way to get the winner of a match?
 
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);



Ryan2 02-23-2021 13:29

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

Originally Posted by Ilusion9 (Post 2737934)
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 :oops:


All times are GMT -4. The time now is 10:55.

Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.