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
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 #1

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 #2

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 #3

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 #4

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
shauli
Member
Join Date: Jun 2018
Old 08-06-2018 , 06:27   Re: How to find out the first player in score tab?
Reply With Quote #5

Quote:
Originally Posted by LemoNSK View Post
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.
That's *exactly* what you should do. Make a for loop and find the player with the most frags.
There's no point in using sort if you only want to get one result/highest result. It's excessive.
shauli is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-06-2018 , 08:16   Re: How to find out the first player in score tab?
Reply With Quote #6

Quote:
Originally Posted by shauli View Post
That's *exactly* what you should do. Make a for loop and find the player with the most frags.
That's exactly what sorting means.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shauli
Member
Join Date: Jun 2018
Old 08-06-2018 , 08:22   Re: How to find out the first player in score tab?
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
That's exactly what sorting means.
No. He should make a for loop and save in a variable the player with the most frags (index & value), not to sort the whole array. SortCustom1D will compare each entry with all of the other different entries, instead of just comparing the entry with the 'best' entry and continue to the next one if it's lower.

Last edited by shauli; 08-06-2018 at 08:22.
shauli 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