Raised This Month: $ Target: $400
 0% 

How to find out the first player in score tab?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-05-2018 , 01:03   How to find out the first player in score tab?
Reply With Quote #1

Hello, I wanted to ask how I am supposed to find out first player in the score tab? 'Cause I am making Improved Team Transfer. I want to find first player with the most score in the tab and replace him with the last one in the other team.
LemoNSK is offline
shauli
Member
Join Date: Jun 2018
Old 08-05-2018 , 05:41   Re: How to find out the first player in score tab?
Reply With Quote #2

Use get_players and then loop through all the players to find out which one has the highest get_user_frags. If two or more players are tied used cs_get_user_deaths as a tie-breaker.

Also bear in mind that the first player on the scoreboard isn't always the best one, a guy with 40 kills and 40 deaths will be 1st and a guy with 38 kills and 2 deaths will be 2nd.

Last edited by shauli; 08-05-2018 at 05:45.
shauli is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 08-05-2018 , 06:17   Re: How to find out the first player in score tab?
Reply With Quote #3

You gotta use get_players twice for both two teams.
__________________
Relaxing is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-05-2018 , 06:35   Re: How to find out the first player in score tab?
Reply With Quote #4

Quote:
Originally Posted by Relaxing View Post
You gotta use get_players twice for both two teams.
Can you give me a small example for this? I would use this command to store how many players there are in each team. Yea, so basically how am I supposed to find the one with the most frags and the one with the lowest one?
LemoNSK is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2018 , 07:57   Re: How to find out the first player in score tab?
Reply With Quote #5

get_players + SortCustom1D

You can search for examples, there are many.
__________________

Last edited by OciXCrom; 08-05-2018 at 07:58.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-05-2018 , 14:36   Re: How to find out the first player in score tab?
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
get_players + SortCustom1D

You can search for examples, there are many.

Still don't understand after some checking.. someone help.
LemoNSK is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-05-2018 , 14:43   Re: How to find out the first player in score tab?
Reply With Quote #7

Try to do it and post the code that you wrote so far. This is the scripting section, so provide your script.
__________________

Last edited by OciXCrom; 08-05-2018 at 14:43.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-05-2018 , 15:12   Re: How to find out the first player in score tab?
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Try to do it and post the code that you wrote so far. This is the scripting section, so provide your script.
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_logevent("round_end"2"1=Round_End");
}


public 
round_end(id) {
      
    new 
players[MAX_PLAYERS];
    static 
numTnumCT;
    
    
get_players(playersnumT"ceh","TERRORIST");
    
get_players(playersnumCT"ceh","CT");
    

This is what I have.. Can't move from here.. So I have actually how many players there are on the server in each team, I thought of making some loop through them so I could find the players with most kills. But it makes no sense to me, there must be some command.
LemoNSK is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-05-2018 , 15:31   Re: How to find out the first player in score tab?
Reply With Quote #9

Quote:
Originally Posted by LemoNSK View Post
PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_logevent("round_end"2"1=Round_End");
}


public 
round_end(id) {
      
    new 
players[MAX_PLAYERS];
    static 
numTnumCT;
    
    
get_players(playersnumT"ceh","TERRORIST");
    
get_players(playersnumCT"ceh","CT");
    

This is what I have.. Can't move from here.. So I have actually how many players there are on the server in each team, I thought of making some loop through them so I could find the players with most kills. But it makes no sense to me, there must be some command.
Well, that's the least you can do. Also don't use static on such things.
__________________
edon1337 is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 08-05-2018 , 15:40   Re: How to find out the first player in score tab?
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
Well, that's the least you can do. Also don't use static on such things.
Ah... thank you for your help lol

Last edited by LemoNSK; 08-05-2018 at 15:50.
LemoNSK is offline
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 12:35.


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