Raised This Month: $ Target: $400
 0% 

Get two biggest of a series of numbers


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-15-2010 , 17:28   Re: Get two biggest of a series of numbers
Reply With Quote #2

Code:
enum _:SortData {     iOriginalIndex,     iValue }; new playersXP[ SH_MAXSLOTS ]; foo( ) {     new eSortData[ SH_MAXSLOTS ][ SortData ];     for( new i = 0; i < SH_MAXSLOTS; i++ )     {         eSortData[ i ][ iOriginalIndex ] = i;         eSortData[ i ][ iValue ] = playersXP[ i ];     }         SortCustom2D( eSortData, SH_MAXSLOTS, "SortData" );         // get top player     new iPlayer1 = eSortData[ 0 ][ iOriginalIndex ];     // get 2nd top player     new iPlayer2 = eSortData[ 1 ][ iOriginalIndex ];     // etc. } public SortData( iElem1[ ], iElem2[ ], iArray[ ], iData[ ], iDataSize ) {     if( iElem1[ iValue ] > iElemt2[ iValue ] ) return -1;     return 1; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 11:23.


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