Raised This Month: $ Target: $400
 0% 

Best 2 CT players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-29-2011 , 11:04   Re: Best 2 CT players
Reply With Quote #5

Quote:
Originally Posted by Backstabnoob View Post
Code:
    new Players[32], iNum, Kills[sizeof(Players)], Best[2], i         get_players(Players, iNum, "e", "TERRORIST")         for(i = 0; i < iNum; i++)         Kills[Players[i]] = get_user_frags(Players[i])         SortIntegers(Kills, sizeof(Players), Sort_Descending)         Best[0] = Kills[0]         get_players(Players, iNum, "e", "CT")         for(i = 0; i < iNum; i++)         Kills[Players[i]] = get_user_frags(Players[i])         SortIntegers(Kills, sizeof(Players), Sort_Descending)         Best[1] = Kills[0]         // best T player: Best[0], best CT player: Best[1]

I guess it can be done without two loops, but I can't think of any other way
That may give fall results. If one person is 10 and 0, and the other is 10 and 40, the 10 and 40 person may be earlier in the array.

Best thing to do with your method is to get the players, run a SortCustom1D on it, and then check the players frags AND deaths to the other. Then return the correct amount for it to sort for you.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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 14:19.


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