Raised This Month: $ Target: $400
 0% 

Top15 Sorting From nVault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-10-2013 , 06:58   Re: Top15 Sorting From nVault
Reply With Quote #1

ok now im using your method hornet... but still having no luck...
Code:
//////////////////////////////////// // Saves Last Man Count To nVault // //////////////////////////////////// public SaveCount( id ) {     new Key[ 64 ], Value[ 64 ], Name[ 32 ];     get_user_name( id, Name, charsmax( Name ) );     formatex( Key, charsmax( Key ), "%s", Name );     formatex( Value, charsmax( Value ), "%d", g_iLastManCount[ id ] );         nvault_set( g_Vault, Key, Value ); } ////////////////////////////////////// // Loads Last Man Count From nVault // ////////////////////////////////////// public LoadCount( id ) {     new Key[ 64 ], Value[ 64 ], Name[ 32 ];     get_user_name( id, Name, charsmax( Name ) );     formatex( Key, charsmax( Key ), "%s", Name );     nvault_get( g_Vault, Key, Value, charsmax( Value ) );         g_iLastManCount[ id ] = str_to_num( Value ); } ///////////////////////////////////////////////////////////////// // Shows The Top 15 Last Man Standing Players Currently Online // ///////////////////////////////////////////////////////////////// public On_nVaultUtil_ReadEntry( i, iTotal, const szKey[], const szData[]/*, iTimeStamp, const Data[], iSize*/ ) {     static ArrayData[ PlayersData ], szRank[ 4 ];         /*  Save name with quotes so it can be parsed */         parse( szData, szRank, charsmax( szRank ), ArrayData[ PLAYER_NAME ], charsmax( ArrayData[ PLAYER_NAME ] ) );         remove_quotes( ArrayData[ PLAYER_NAME ] );     ArrayData[ PLAYER_RANK ] = str_to_num( szRank );         ArrayPushArray( g_PlayersArray, ArrayData ); } public ArrayItem_Compare( Array:array, iItem1, iItem2/*, const szData[], iSize*/ ) {     static ArrayData1[ PlayersData ], ArrayData2[ PlayersData ];         ArrayGetArray( g_PlayersArray, iItem1, ArrayData1 );     ArrayGetArray( g_PlayersArray, iItem2, ArrayData2 );         return clamp( ArrayData2[ PLAYER_RANK ] - ArrayData1[ PLAYER_RANK ], -1, 1 ); } public ClientCommand_ShowMotd( id ) {     new iSize = ArraySize( g_PlayersArray );             new ArrayData[ PlayersData ];         new motd[ 1501 ], iLen;     iLen = format( motd, charsmax( motd ), "<body background='http://i.snapthat.net/cXiy.png'><font color=#98f5ff size=4><b><pre>");     iLen += format( motd[ iLen ], ( charsmax( motd ) ) - iLen,"%-5.5s %-22.22s %3s^n", "Rank", "Name", "Time(s) LMS");         for( new i ; i < iSize ; i ++ )     {         ArrayGetArray( g_PlayersArray, i, ArrayData );                 iLen += format( motd[ iLen ], ( charsmax( motd ) ) - iLen,"%-5.5d %-22.22s %d^n", ArrayData[ PLAYER_RANK ], ArrayData[ PLAYER_NAME ], g_iLastManCount[ i ]);                 /*  Add your player into MOTD string here. int i in each iteration         will hold the index of the entry with the next player in order by         rank.                 ArrayData[ PLAYER_NAME ] - Is the string holding player's name         ArrayData[ PLAYER_RANK ] - Is the int holding player's rank         */     }           iLen += format( motd[ iLen ], ( charsmax( motd ) ) - iLen, "</body></font></b></pre>" );     show_motd( id, motd, "Last Man Standing Top15" ); }

it appears like this.

__________________
Blizzard_87 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 10:47.


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