Raised This Month: $ Target: $400
 0% 

getting max number of teams?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-07-2010 , 00:51   Re: getting max number of teams?
Reply With Quote #8

Quote:
Originally Posted by HLM View Post
PHP Code:
// there HAS to be an easier way... 
will this work as intended? I am assuming no, since there is the possibility that team1 could have 4 peopls team2 4 team3 5 team4 6 and it will probably be wrong..
I'm sure there is a more dynamic way but it probably won't be easy. First of all, what mod has more than two team? And, I have a hard time believing that get_user_team() will return 0 for spectator on any mod. CS and DOD both have spec that are non-zero IIRC.

Quote:
Originally Posted by RedRobster View Post
Well, when looping through the players, make sure to do
PHP Code:
new players[32], pnum
get_players
(playerspnum)
for(new 
ipnumi++)
{
        new 
tempid players[i]

The way you are doing it, it will loop through 33 times instead of just 32 as well.
Note: You don't need to cache the player id if it is only used once. He could just as easily do switch(get_user_team(players[i])).
__________________

Last edited by fysiks; 07-07-2010 at 02:11.
fysiks is offline
 



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 07:10.


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