AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   (HELP) Check if all in one team (https://forums.alliedmods.net/showthread.php?t=308195)

Question x Mark 06-10-2018 02:33

(HELP) Check if all in one team
 
How do i check if all the players are in one team.
If all of them are in one team, then do round win/end an balance team.

Natsheh 06-10-2018 02:39

Re: (HELP) Check if all in one team
 
get teams players num check if team1 players are 0 and the other has players restart the round.

instinctpt1 06-10-2018 03:48

Re: (HELP) Check if all in one team
 
Something like this maybe ..
PHP Code:

new players[32], count

    get_players
(playerscount"e""CT")
    if(
count 31server_cmd("sv_restart 1")
    else if(
count == 0server_cmd("sv_restart 1"


CrAzY MaN 06-10-2018 04:27

Re: (HELP) Check if all in one team
 
Quote:

Originally Posted by instinctpt1 (Post 2596191)
Something like this maybe ..
PHP Code:

new players[32], count

    get_players
(playerscount"e""CT")
    if(
count 31server_cmd("sv_restart 1")
    else if(
count == 0server_cmd("sv_restart 1"


Doesn't need to check
Code:
if(count > 31) server_cmd("sv_restart 1")

Relaxing 06-10-2018 04:39

Re: (HELP) Check if all in one team
 
You must check current online players before doing any of these.

instinctpt1 06-10-2018 05:17

Re: (HELP) Check if all in one team
 
What if there are 32 CTS ?

It is req. to perform both checks i guess..

Relaxing 06-10-2018 06:02

Re: (HELP) Check if all in one team
 
Checking if there's 32 CTs but in fact there's 20 current players it will be marked as a false return.
Code:
new current_players = get_playersnum() if (count == (current_players - current_bots))

Natsheh 06-10-2018 11:33

Re: (HELP) Check if all in one team
 
Why are you all complicating things

Just check if one of teams has players and the other doesnt.

if(terr_num > 1 && !ctnum || ctnum > 1 && !terr_num)
.......

CrAzY MaN 06-10-2018 12:01

Re: (HELP) Check if all in one team
 
Quote:

Originally Posted by Natsheh (Post 2596257)
Why are you all complicating things

Just check if one of teams has players and the other doesnt.

if(terr_num > 1 && !ctnum || ctnum > 1 && !terr_num)
.......

Thats what i said


All times are GMT -4. The time now is 04:40.

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