Raised This Month: $ Target: $400
 0% 

[L4D2] How to detect winner teams ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 04:45.


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