Guest User

Untitled

a guest
Apr 12th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.45 KB | None | 0 0
  1. stock fill ( array[][] )
  2. {
  3.     new x_count;
  4.     for ( new g = 0; g < MAX_PLAYERS; g++ )
  5.         if ( IsPlayerConnected ( g ) )
  6.         {
  7.             x_count++;
  8.             array[g][1] = g;
  9.             array[g][0] = GetPlayerScore ( g );
  10.         }
  11.     return x_count;
  12. }
  13.  
  14. //*****************************************************************************
  15. stock process ( array[][] , size = sizeof ( array ) )
  16. {
  17.     if ( size > 1 )
  18.     {
  19.         new
  20.             bool:flag,
  21.             tmpx;
  22.         do
  23.         {
  24.             flag = true;
  25.             for ( new i = size - 1; i > 0; i-- )
  26.                 if ( array[i][0] < array[i - 1][0] )
  27.                 {
  28.                     tmpx = array[i][0];
  29.                     array[i][0] = array[i - 1][0];
  30.                     array[i - 1][0] = tmpx;
  31.                     tmpx = array[i][1];
  32.                     array[i][1] = array[i - 1][1];
  33.                     array[i - 1][1] = tmpx;
  34.                     flag = false;
  35.                 }
  36.         }
  37.         while flag == false;
  38.     }
  39. }
  40. //*****************************************************************************
  41. stock CreateTop ( array[][] , max , count = 10 )
  42. {
  43.     new
  44.     str[64],
  45.     pln[24];
  46.     for ( new i = 0; i < ( ( max < count) ? max : count ); i++ )
  47.     {
  48.        GetPlayerName ( array[i][1] , pln , sizeof ( pln ) );
  49.        format(str, sizeof (str),"%d.%s: %d", i + 1 , pln , array[i][0] );
  50.        SendClientMessageToAll ( 0x33FF33AA , str );
  51.     }
  52.     return true;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment