View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-12-2020 , 22:28   Re: Stock to detect when a team dies
Reply With Quote #2

You can easily hook when a team wins, if that solves your problem. The below will handle when all players die on a particular team.
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init() 
{
    
RegisterHamHam_Killed "player" "HamKilled_Post" true );
}

public 
HamKilled_PostiPlayer )
{
    new 
iPlayers32 ] , iNum CsTeams:csPlayerTeam;
    
    
csPlayerTeam cs_get_user_teamiPlayer );
    
get_playersiPlayers iNum "ae" , ( csPlayerTeam == CS_TEAM_T ) ? "TERRORIST" "CT" );
    
    if ( !
iNum )
    {
        
AllPlayersDeadcsPlayerTeam );
    }
}

public 
AllPlayersDeadCsTeams:csDeadTeam )
{
    
//All players on csDeadTeam are dead
    

__________________

Last edited by Bugsy; 05-12-2020 at 22:45.
Bugsy is offline