Guest User

Movie stripes by Correlli

a guest
Dec 12th, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.06 KB | None | 0 0
  1. /*  stripes.inc
  2.  *
  3.  *  (c) Copyright 2016-2017, Emilijo "Correlli" Lovrich
  4.  *
  5.  *  Credits: - BloodMaster for idea.
  6. */
  7.  
  8. #include "a_samp"
  9.  
  10. #define COLOR_WHITE                                                             (0xFFFFFFFF)
  11. #define COLOR_BLACK                                                             (0x000000FF)
  12. #define MAX_STRIPE_TEXTDRAWS                                                    (178)
  13.  
  14. new
  15.         bool:g_Stripe[MAX_PLAYERS],
  16.  
  17.         PlayerText:pStripeTD[MAX_PLAYERS][MAX_STRIPE_TEXTDRAWS]
  18. ;
  19.  
  20. stock CreateStripes(playerid, Float:offset = 0.0)
  21. {
  22.     if(g_Stripe[playerid])
  23.         return false;
  24.     new
  25.             a, b, c, d, count = 2;
  26.     // Black backgrounds.
  27.     pStripeTD[playerid][0] = CreatePlayerTextDraw(playerid, -10.0, -10.0, "text");
  28.     pStripeTD[playerid][1] = CreatePlayerTextDraw(playerid, 600.0, -10.0, "text");
  29.     for(a = 0; a < 2; a++)
  30.     {
  31.         PlayerTextDrawFont(playerid,        pStripeTD[playerid][a],                         1);
  32.         PlayerTextDrawLetterSize(playerid,  pStripeTD[playerid][a],                 0.0, 52.0);
  33.         PlayerTextDrawUseBox(playerid,      pStripeTD[playerid][a],                         1);
  34.         PlayerTextDrawBoxColor(playerid,    pStripeTD[playerid][a],               COLOR_BLACK);
  35.         PlayerTextDrawTextSize(playerid,    pStripeTD[playerid][a], (40.0 + (610.0 * a)), 0.0);
  36.         PlayerTextDrawShow(playerid,        pStripeTD[playerid][a]);
  37.     }
  38.     // Big stripes.
  39.     for(a = 0; a < 2; a++)
  40.     {
  41.         for(b = 0; b < 8; b++)
  42.         {
  43.             pStripeTD[playerid][count] = CreatePlayerTextDraw(playerid, (10.0 + (600.0 * a)), (offset + -12.0 + (60.0 * b)), "text");
  44.             PlayerTextDrawFont(playerid,        pStripeTD[playerid][count],                         1);
  45.             PlayerTextDrawLetterSize(playerid,  pStripeTD[playerid][count],                  0.0, 5.0);
  46.             PlayerTextDrawUseBox(playerid,      pStripeTD[playerid][count],                         1);
  47.             PlayerTextDrawBoxColor(playerid,    pStripeTD[playerid][count],               COLOR_WHITE);
  48.             PlayerTextDrawTextSize(playerid,    pStripeTD[playerid][count], (30.0 + (600.0 * a)), 0.0);
  49.             PlayerTextDrawShow(playerid,        pStripeTD[playerid][count]);
  50.             count++;
  51.         }
  52.     }
  53.     // Small stripes.
  54.     for(a = 0; a < 2; a++)
  55.     {
  56.         for(b = 0; b < 2; b++)
  57.         {
  58.             for(c = 0; c < 5; c++)
  59.             {
  60.                 for(d = 0; d < 8; d++)
  61.                 {
  62.                     pStripeTD[playerid][count] = CreatePlayerTextDraw(playerid, (3.0 + (600.0 * a) + (33.0 * b)), (offset + -13.0 + (11.0 * c) + (60.0 * d)), "text");
  63.                     PlayerTextDrawFont(playerid,        pStripeTD[playerid][count],                                     1);
  64.                     PlayerTextDrawLetterSize(playerid,  pStripeTD[playerid][count],                              0.0, 0.2);
  65.                     PlayerTextDrawUseBox(playerid,      pStripeTD[playerid][count],                                     1);
  66.                     PlayerTextDrawBoxColor(playerid,    pStripeTD[playerid][count],                           COLOR_WHITE);
  67.                     PlayerTextDrawTextSize(playerid,    pStripeTD[playerid][count], (5.0 + (600.0 * a) + (33.0 * b)), 0.0);
  68.                     PlayerTextDrawShow(playerid,        pStripeTD[playerid][count]);
  69.                     count++;
  70.                 }
  71.             }
  72.         }
  73.     }
  74.     g_Stripe[playerid] = true;
  75.     return true;
  76. }
  77.  
  78. stock DestroyStripes(playerid)
  79. {
  80.     if(!g_Stripe[playerid])
  81.         return false;
  82.     for(new a = 0; a < MAX_STRIPE_TEXTDRAWS; a++)
  83.         PlayerTextDrawDestroy(playerid, pStripeTD[playerid][a]);
  84.     g_Stripe[playerid] = false;
  85.     return true;
  86. }
  87.  
  88. stock MoveStripes(playerid)
  89. {
  90.     DestroyStripes(playerid);
  91.     CreateStripes(playerid, float(random(200) / 10));
  92.     return true;
  93. }
Add Comment
Please, Sign In to add comment