Best 2 CT players
How to find 2 best players in CT? (TAB, first and second one)
|
Re: Best 2 CT players
Use a sort algorithm (I would suggest an insertion sort for this small amount of data). Search for it on the internet.
Then take the last 2 slots of the array (or first 2 if you sort in descending order), and those are your top 2 players. |
Re: Best 2 CT players
Check player team and frags.
|
Re: Best 2 CT players
Code:
I guess it can be done without two loops, but I can't think of any other way |
Re: Best 2 CT players
Quote:
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. |
Re: Best 2 CT players
Good catch, haven't thought of that.
|
Re: Best 2 CT players
Not tested:
PHP Code:
I think that it has the same bug that Backstabnoob made in his script |
Re: Best 2 CT players
you can check scoreboard.cpp in hlsdk to see how it managed.
|
Re: Best 2 CT players
Code:
So I guess they've done it as I thought before. This should be the right conversion: Code:
However this will print only one player. |
Re: Best 2 CT players
kotinha's code should work fine.
As far as I know, the scoreboard is set by at the top whoever has the highest kills, no matter their amount of deaths. However, if two people have the same amount of kills, the one with the lower amount of deaths goes higher in the scoreboard. |
| All times are GMT -4. The time now is 14:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.