Raised This Month: $ Target: $400
 0% 

Proper way of getting ratio of teams?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 08-17-2009 , 23:11   Re: Proper way of getting ratio of teams?
Reply With Quote #6

Based on the code above:

PHP Code:
    new playersCount[3Players[32],pnum;
    
    
get_playersPlayerspnum "a" ); //only alive players
    
for( new =0pnumi++ )
    {
        
playersCount[get_user_team(Players[i])]++
    }
    
    new 
Float:ratio playersCount[1] / (playersCount[1]+playersCount[2]) 
Edit:
in the code above i'm calculating the ratio of T players per alive players. What makes that if there are 5 T's and 10 Ct's it will give 0.3(3). But, you just want the ratio of T's per Ct's so the way you doing is correct

PHP Code:
  new Float:ratio playersCount[1] / playersCount[2
It would give 0.5
__________________

Last edited by joaquimandrade; 08-17-2009 at 23:19.
joaquimandrade 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 15:08.


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