Raised This Month: $ Target: $400
 0% 

Sort all arrays with one func


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-25-2017 , 19:36   Sort all arrays with one func
Reply With Quote #1

I'm trying to get the most knife kills/HS kills, etc just with one function

Thats what I have

PHP Code:
GetTop()
{
    new 
iPlayers[32], iPlayersnumPlayer;
    
    
get_players(iPlayersiPlayersnum)
    
    for(new 
i;iPlayersnum;i++)
    {
        
Player iPlayers[i]
        
        
SortCustom(PlayeriPlayersnumPlayerData[Player][arItemsBought])
    }
    return 
Player[0]
}

SortCustom(elem1elem2, array[]) 
{
    if(array[
elem1] > array[elem2])
        return -
1
        
    
else if(array[elem1] < array[elem2])
        return 
1
        
    
return 0

I have picked it up from Kia's MPV. I know that GetTop() will return the last player, but how can I return the player that have the biggest array's size ? ( arItemsBought ).
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-25-2017 at 19:37.
EFFx is offline
 


Thread Tools
Display Modes

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 20:58.


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