Raised This Month: $ Target: $400
 0% 

[L4D2] How to detect winner teams ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
oqyh
Senior Member
Join Date: May 2019
Location: United Arab Emirates
Old 11-16-2022 , 02:39   Re: [L4D2] How to detect winner teams ?
Reply With Quote #2

PHP Code:
#pragma semicolon 1
#pragma newdecls required

//////here is list of L4D Teams///////////////////
#define SPECTEAM 1
#define SURVIVORTEAM 2
#define INFECTEDTEAM 3
///////////////////////////////////////////////

#include <sourcemod>

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<= MaxClients; ++i)
    {
        if (
IsClientInGame(i))
        {
            if (
IsPlayerAlive(i))
            {
                if (
WinnerTeam == SURVIVORTEAM//so if WinnerTeam which is GetEventInt the winner, and int on top at define are equal together means team winner
                
{
                    
//do stuff here if survivor win
                
}else if (WinnerTeam == INFECTEDTEAM//here also same but we change to infected team
                
{
                    
//do stuff here if infected win
                
}
            }
        }
    }

__________________
.:[ >> My Plugins << ]:.

My discord : oqyh

Last edited by oqyh; 11-16-2022 at 07:33.
oqyh 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 00:59.


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