Raised This Month: $ Target: $400
 0% 

Check teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 07-12-2013 , 15:44   Check teams
Reply With Quote #1

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() 
  }
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-12-2013 , 16:09   Re: Check teams
Reply With Quote #2

Code:
==
->
Code:
<=
Backstabnoob is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-12-2013 , 16:10   Re: Check teams
Reply With Quote #3

t_count == 8
->
t_count <= 8

You could also use the flags "e" with "TERRORIST" and "CT" to get count more efficiently.
__________________
Arkshine is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 07-22-2013 , 11:55   Re: Check teams
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
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
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 07-22-2013 , 12:25   Re: Check teams
Reply With Quote #5

=> will give error. Use >=
devWaleed is offline
Send a message via Skype™ to devWaleed
Reply



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 06:31.


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