Raised This Month: $79 Target: $400
 19% 

Solved [CSGO] Finding alive players on a team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PeterPan
Junior Member
Join Date: Mar 2020
Old 09-25-2020 , 06:15   [CSGO] Finding alive players on a team
Reply With Quote #1

How would I go around checking if CT/T had any living players?

Basically wanting to check if there are alive players on a team then if there's not execute a command

Last edited by PeterPan; 09-26-2020 at 09:00.
PeterPan is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 09-25-2020 , 07:27   Re: [CSGO] Finding alive players on a team
Reply With Quote #2

PHP Code:
bool IsPlayerAliveOnTeam(int team)
{
    for (
int i 1<= MaxClientsi++) {
        if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == team) {
            return 
true;
        }
    }

    return 
false;
}

// In some other function
if (!IsPlayerAliveOnTeam(CS_TEAM_CT)) {
  
// No CTs alive

__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
I do not provide support in PMs. Please use the forum thread.
DJ Tsunami is offline
PeterPan
Junior Member
Join Date: Mar 2020
Old 09-26-2020 , 09:00   Re: [CSGO] Finding alive players on a team
Reply With Quote #3

Works great, thank you.
PeterPan is offline
Reply


Thread Tools
Display Modes

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 02:54.


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