Advertisement
garfield

[INC]: Fasted Loopings

Jul 1st, 2012
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.19 KB | None | 0 0
  1. //           Fasted Loopings By SuYaNw / Garfield
  2.  
  3. #include a_samp
  4.  
  5.  
  6.  
  7. stock slPlayers;
  8.  
  9. public OnPlayerConnect(playerid)                return slPlayers++;
  10. public OnPlayerDisconnect(playerid, reason)     return slPlayers--;
  11.  
  12.  
  13.  
  14. #if defined _ALS_OnPlayerConnect
  15.     #undef OnPlayerConnect
  16. #else
  17.     #define _ALS_OnPlayerConnect
  18. #endif
  19. #define OnPlayerConnect sOnPlayerConnect
  20.  
  21. #if defined _ALS_OnPlayerDisconnect
  22.     #undef OnPlayerConnect
  23. #else
  24.     #define _ALS_OnPlayerDisconnect
  25. #endif
  26. #define OnPlayerDisconnect sOnPlayerDisconnect
  27.  
  28.  
  29. sOnPlayerConnect(playerid);
  30. aOnPlayerDisconnect(playerid);
  31.  
  32.  
  33. #define sPlayers(%0,%1) \
  34.                             new bool:g___ = %1, c___;c___ = (g___ ? (slPlayers) : (GetMaxPlayers())); \
  35.                             for(new %0, getAdicional = c___ == 0 ? (c___ + 0x1) : (c___); %0 != _: (getAdicional); ++%0)
  36.  
  37.  
  38. // Test
  39. public OnFilterScriptInit()
  40. {
  41.     //new PlayerTextDraw[MAX_PLAYERS];
  42.    
  43.     sPlayers(i, false)
  44.     {
  45.         //PlayerTextDraw[i] = CreateTextDraw(125.200, 100.000, "Hi ;)");
  46.         printf("Modo: %s | Percorrer: %i", g___ ? ("All_Players") : ("GetMaxPlayers"), i);
  47.         /* */
  48.     }
  49.    
  50.     //  printf("Modo: %s | Percorrer: %i", g___ ? ("All_Players") : ("GetMaxPlayers"), i);
  51.     return true;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement