Advertisement
DraKiNs

[COD] Fila de Espera

Jun 27th, 2011
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.69 KB | None | 0 0
  1. new
  2.     pFila[MAX_PLAYERS],
  3.     iTotalPlayersFila = 0xFFFFFFFF
  4. ;
  5.  
  6. #define JogadoresFila(%0) for(new %0_, %0; %0_ < (iTotalPlayersFila + 1); %0_++, %0 = pFila[%0_])
  7. #define AddPlayerFila(%0) pFila[++iTotalPlayersFila] = %0
  8. #define RemPlayerFila(%0) DeleteIterator(%0)
  9.  
  10. DeleteIterator(iter)
  11. {
  12.     for(new i; i < (sizeof(pFila)-1); ++i) {
  13.         while(pFila[++i] == iter && i < (sizeof(pFila)-1)) {
  14.             pFila[ i ] ^= pFila[i+1],pFila[i+1] ^= pFila[ i ],pFila[ i ] ^= pFila[i+1];
  15.         }
  16.         i -= 1;
  17.     }
  18.     return true;
  19. }
  20.  
  21.  
  22. /*
  23.    Exemplo:
  24.  
  25. JogadoresFila(i)
  26. {
  27.     printf("JOGADOR ID %d - NUMERO FILA %d", i, i_);
  28. }
  29.  
  30. // By DraKiNs
  31. // www.ips-team.blogspot.com
  32. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement