Advertisement
Guest User

Weird SA-MP Textdraw order

a guest
Mar 8th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.80 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3. #include <zcmd>
  4. #define RGB(%0,%1,%2,%3) ((%0*16777216)+(%1*65536)+(%2*256)+%3)
  5.  
  6. new PlayerText:Text[MAX_PLAYERS][4],
  7.     PlayerText:Screen[MAX_PLAYERS];
  8.  
  9. CMD:run(playerid)
  10. {  
  11.     Text[playerid][0] = CreatePlayerTextDraw(playerid, 2.333477, 402.370513, "Some");
  12.     PlayerTextDrawLetterSize(playerid, Text[playerid][0], 0.400000, 2.200000);
  13.     PlayerTextDrawAlignment(playerid, Text[playerid][0], 1);
  14.     PlayerTextDrawColor(playerid, Text[playerid][0], -1);
  15.     PlayerTextDrawSetShadow(playerid, Text[playerid][0], 0);
  16.     PlayerTextDrawSetOutline(playerid, Text[playerid][0], 1);
  17.     PlayerTextDrawBackgroundColor(playerid, Text[playerid][0], 51);
  18.     PlayerTextDrawFont(playerid, Text[playerid][0], 3);
  19.     PlayerTextDrawSetProportional(playerid, Text[playerid][0], 1);
  20.    
  21.     Text[playerid][1] = CreatePlayerTextDraw(playerid, 9.999933, 415.644744, "Nice");
  22.     PlayerTextDrawLetterSize(playerid, Text[playerid][1], 0.400000, 2.200000);
  23.     PlayerTextDrawAlignment(playerid, Text[playerid][1], 1);
  24.     PlayerTextDrawColor(playerid, Text[playerid][1], -16776961);
  25.     PlayerTextDrawSetShadow(playerid, Text[playerid][1], 0);
  26.     PlayerTextDrawSetOutline(playerid, Text[playerid][1], 1);
  27.     PlayerTextDrawBackgroundColor(playerid, Text[playerid][1], 51);
  28.     PlayerTextDrawFont(playerid, Text[playerid][1], 3);
  29.     PlayerTextDrawSetProportional(playerid, Text[playerid][1], 1);
  30.    
  31.     Text[playerid][2] = CreatePlayerTextDraw(playerid, 5.000047, 427.429992, "Text");
  32.     PlayerTextDrawLetterSize(playerid, Text[playerid][2], 0.400000, 2.200000);
  33.     PlayerTextDrawAlignment(playerid, Text[playerid][2], 1);
  34.     PlayerTextDrawColor(playerid, Text[playerid][2], -1);
  35.     PlayerTextDrawSetShadow(playerid, Text[playerid][2], 0);
  36.     PlayerTextDrawSetOutline(playerid, Text[playerid][2], 1);
  37.     PlayerTextDrawBackgroundColor(playerid, Text[playerid][2], 51);
  38.     PlayerTextDrawFont(playerid, Text[playerid][2], 3);
  39.     PlayerTextDrawSetProportional(playerid, Text[playerid][2], 1);
  40.    
  41.     Text[playerid][3]               = CreatePlayerTextDraw(playerid, 5.000047, 390.4299920, "Hello");
  42.     PlayerTextDrawBackgroundColor       (playerid, Text[playerid][3], 255);
  43.     PlayerTextDrawFont                  (playerid, Text[playerid][3], 1);
  44.     PlayerTextDrawLetterSize            (playerid, Text[playerid][3], 0.170000, 0.799998);
  45.     PlayerTextDrawColor                 (playerid, Text[playerid][3], -1);
  46.     PlayerTextDrawSetOutline            (playerid, Text[playerid][3], 1);
  47.     PlayerTextDrawSetProportional       (playerid, Text[playerid][3], 1);
  48.     PlayerTextDrawSetSelectable         (playerid, Text[playerid][3], 0);  
  49.  
  50.     for(new i=3; i>=0; --i)
  51.         PlayerTextDrawShow(playerid, Text[playerid][i]);
  52.  
  53.     Screen[playerid] = CreatePlayerTextDraw(playerid, 0.0, 0.0, "_");
  54.     PlayerTextDrawAlignment(playerid, Screen[playerid], 0);
  55.     PlayerTextDrawFont(playerid, Screen[playerid], 3);
  56.     PlayerTextDrawLetterSize(playerid, Screen[playerid], 1.0,480.0);
  57.     PlayerTextDrawUseBox(playerid, Screen[playerid], 1);
  58.     PlayerTextDrawBoxColor(playerid, Screen[playerid], RGB(0,0,0,255));
  59.     PlayerTextDrawTextSize(playerid, Screen[playerid], 640.000000,480.000000);
  60.     PlayerTextDrawShow(playerid, Screen[playerid]);
  61.  
  62.     printf("%d, %d, %d, %d", Text[playerid][0], Text[playerid][1], Text[playerid][2], Text[playerid][3]);
  63.     return 1;
  64. }
  65.  
  66. CMD:destroy(playerid)
  67. {
  68.     PlayerTextDrawHide(playerid, Text[playerid][0]);
  69.     PlayerTextDrawHide(playerid, Text[playerid][2]);
  70.     PlayerTextDrawHide(playerid, Text[playerid][3]);   
  71.     PlayerTextDrawDestroy(playerid, Text[playerid][0]);
  72.     PlayerTextDrawDestroy(playerid, Text[playerid][2]);
  73.     PlayerTextDrawDestroy(playerid, Text[playerid][3]);
  74.     return 1;
  75. }
  76.  
  77. CMD:destroy1(playerid)
  78. {
  79.     PlayerTextDrawHide(playerid, Text[playerid][1]);
  80.     PlayerTextDrawDestroy(playerid, Text[playerid][1]);
  81.     return 1;
  82. }
  83.  
  84. CMD:screenoff(playerid)
  85. {
  86.     PlayerTextDrawHide(playerid, Screen[playerid]);
  87.     PlayerTextDrawDestroy(playerid, Screen[playerid]);
  88.     return 1;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement