AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check teams (https://forums.alliedmods.net/showthread.php?t=220628)

ironskillz1 07-12-2013 15:44

Check teams
 
This code checks if its 8 terroist alive

but how can i check if 8 and under 8 terroist alive?

Code:

  new t_count, ct_count, num, players[32], tempid
  get_players ( players, num )
 
  for ( new i = 0; i < num; i++ )
  {
  tempid = players [ i ]
 
  if ( cs_get_user_team ( tempid ) == CS_TEAM_T && is_user_alive ( tempid ) )
    t_count++
 
  if ( cs_get_user_team ( tempid ) == CS_TEAM_CT && is_user_alive ( tempid ) )
    ct_count++
  }
  if ( t_count == 8 )
  { 
  RandomCT()
  }


Backstabnoob 07-12-2013 16:09

Re: Check teams
 
Code:
==
->
Code:
<=

Arkshine 07-12-2013 16:10

Re: Check teams
 
t_count == 8
->
t_count <= 8

You could also use the flags "e" with "TERRORIST" and "CT" to get count more efficiently.

ironskillz1 07-22-2013 11:55

Re: Check teams
 
Quote:

Originally Posted by Arkshine (Post 1989564)
t_count == 8
->
t_count <= 8

You could also use the flags "e" with "TERRORIST" and "CT" to get count more efficiently.



And 8 T and more?

its like this then

t_count => 8

devWaleed 07-22-2013 12:25

Re: Check teams
 
=> will give error. Use >=


All times are GMT -4. The time now is 06:31.

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