Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* stripes.inc
- *
- * (c) Copyright 2016-2017, Emilijo "Correlli" Lovrich
- *
- * Credits: - BloodMaster for idea.
- */
- #include "a_samp"
- #define COLOR_WHITE (0xFFFFFFFF)
- #define COLOR_BLACK (0x000000FF)
- #define MAX_STRIPE_TEXTDRAWS (178)
- new
- bool:g_Stripe[MAX_PLAYERS],
- PlayerText:pStripeTD[MAX_PLAYERS][MAX_STRIPE_TEXTDRAWS]
- ;
- stock CreateStripes(playerid, Float:offset = 0.0)
- {
- if(g_Stripe[playerid])
- return false;
- new
- a, b, c, d, count = 2;
- // Black backgrounds.
- pStripeTD[playerid][0] = CreatePlayerTextDraw(playerid, -10.0, -10.0, "text");
- pStripeTD[playerid][1] = CreatePlayerTextDraw(playerid, 600.0, -10.0, "text");
- for(a = 0; a < 2; a++)
- {
- PlayerTextDrawFont(playerid, pStripeTD[playerid][a], 1);
- PlayerTextDrawLetterSize(playerid, pStripeTD[playerid][a], 0.0, 52.0);
- PlayerTextDrawUseBox(playerid, pStripeTD[playerid][a], 1);
- PlayerTextDrawBoxColor(playerid, pStripeTD[playerid][a], COLOR_BLACK);
- PlayerTextDrawTextSize(playerid, pStripeTD[playerid][a], (40.0 + (610.0 * a)), 0.0);
- PlayerTextDrawShow(playerid, pStripeTD[playerid][a]);
- }
- // Big stripes.
- for(a = 0; a < 2; a++)
- {
- for(b = 0; b < 8; b++)
- {
- pStripeTD[playerid][count] = CreatePlayerTextDraw(playerid, (10.0 + (600.0 * a)), (offset + -12.0 + (60.0 * b)), "text");
- PlayerTextDrawFont(playerid, pStripeTD[playerid][count], 1);
- PlayerTextDrawLetterSize(playerid, pStripeTD[playerid][count], 0.0, 5.0);
- PlayerTextDrawUseBox(playerid, pStripeTD[playerid][count], 1);
- PlayerTextDrawBoxColor(playerid, pStripeTD[playerid][count], COLOR_WHITE);
- PlayerTextDrawTextSize(playerid, pStripeTD[playerid][count], (30.0 + (600.0 * a)), 0.0);
- PlayerTextDrawShow(playerid, pStripeTD[playerid][count]);
- count++;
- }
- }
- // Small stripes.
- for(a = 0; a < 2; a++)
- {
- for(b = 0; b < 2; b++)
- {
- for(c = 0; c < 5; c++)
- {
- for(d = 0; d < 8; d++)
- {
- pStripeTD[playerid][count] = CreatePlayerTextDraw(playerid, (3.0 + (600.0 * a) + (33.0 * b)), (offset + -13.0 + (11.0 * c) + (60.0 * d)), "text");
- PlayerTextDrawFont(playerid, pStripeTD[playerid][count], 1);
- PlayerTextDrawLetterSize(playerid, pStripeTD[playerid][count], 0.0, 0.2);
- PlayerTextDrawUseBox(playerid, pStripeTD[playerid][count], 1);
- PlayerTextDrawBoxColor(playerid, pStripeTD[playerid][count], COLOR_WHITE);
- PlayerTextDrawTextSize(playerid, pStripeTD[playerid][count], (5.0 + (600.0 * a) + (33.0 * b)), 0.0);
- PlayerTextDrawShow(playerid, pStripeTD[playerid][count]);
- count++;
- }
- }
- }
- }
- g_Stripe[playerid] = true;
- return true;
- }
- stock DestroyStripes(playerid)
- {
- if(!g_Stripe[playerid])
- return false;
- for(new a = 0; a < MAX_STRIPE_TEXTDRAWS; a++)
- PlayerTextDrawDestroy(playerid, pStripeTD[playerid][a]);
- g_Stripe[playerid] = false;
- return true;
- }
- stock MoveStripes(playerid)
- {
- DestroyStripes(playerid);
- CreateStripes(playerid, float(random(200) / 10));
- return true;
- }
Add Comment
Please, Sign In to add comment