View Single Post
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 11-15-2022 , 16:30   [L4D2] How to detect winner teams ?
Reply With Quote #1

Hello guys,

When trying to detect winners team for l4d2 while hooking round_end event, winners team will be equal to 0 ???

If this method doesnt work, is there any other way to do so?

Thanks

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("round_end"Event_RoundEnd);
}

void Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    
int WinnerTeam GetEventInt(event"winner");
    
    for (
int i 1<= MaxClientsi++)
    {
        if(
GetClientTeam(i) == WinnerTeamPrintToChat(i"Winner Team == %d"WinnerTeam);
        else 
PrintToChat(i"Losing Team != %d"WinnerTeam);
    }

__________________

Last edited by alasfourom; 11-15-2022 at 16:32.
alasfourom is offline