Advertisement
Guest User

dialogs.inc fix by Nick

a guest
Aug 13th, 2016
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 33.24 KB | None | 0 0
  1. #if defined _dialogs_included
  2.     #endinput
  3. #endif
  4. #define _dialogs_included
  5.  
  6. /*
  7.  * dialogs.inc
  8.  * Version: v2.7.2 (last updated: 11 August, 2016)
  9.  * By Gammix
  10.  * Fix 13/08/2016 by NicK
  11.  *
  12.  * Functions:
  13.    native ShowPlayerPreviewModelDialog(playerid, dialogid, style, caption[], models[], labels[][], button1[], button2[], limit = sizeof (models));
  14.    native Dialog_SetListModelRotation(playerid, listitem, Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:zoom = 1.0, color1 = -1, color2 = -1);
  15.  *
  16.  */
  17.  
  18. enum
  19. {
  20.     DIALOG_STYLE_PREVMODEL = 6,
  21.     DIALOG_STYLE_PREVMODEL_LIST
  22. };
  23.  
  24. #define DIALOG_MAX_TEXT_DRAWS (100)
  25.  
  26. #define DIALOG_MAX_LISTITEM_SIZE (150)
  27.  
  28. #define Dialog_CountPages(%0,%1) \
  29.     (((%0) - 1) / (%1) + 1)
  30.  
  31. #define Dialog_SetOpacity(%0,%1) \
  32.     ((%0 & ~0xFF) | clamp(%1, 0x00, 0xFF))
  33.  
  34. new PlayerText:p_DialogTextDraw[MAX_PLAYERS][DIALOG_MAX_TEXT_DRAWS];
  35. new p_DialogTextDrawPool[MAX_PLAYERS];
  36. new Float:p_DialogModelRot[MAX_PLAYERS][DIALOG_MAX_TEXT_DRAWS][4];
  37. new p_DialogModelVehCol[MAX_PLAYERS][DIALOG_MAX_TEXT_DRAWS][2];
  38.  
  39. enum E_PLAYER_DIALOG
  40. {
  41.             E_PLAYER_DIALOG_ID,
  42.             E_PLAYER_DIALOG_STYLE,
  43.     bool:   E_PLAYER_DIALOG_DUAL_BTN,
  44.             E_PLAYER_DIALOG_LISTITEMS,
  45.             E_PLAYER_DIALOG_LISTITEM_ID,
  46.             E_PLAYER_DIALOG_PAGE,
  47.             E_PLAYER_DIALOG_CLICK_TICKCOUNT,
  48.     bool:   E_PLAYER_DIALOG_CANCELED
  49. };
  50. new p_Dialog[MAX_PLAYERS][E_PLAYER_DIALOG];
  51.  
  52. enum E_DIALOG_COMPONENT
  53. {
  54.     E_DIALOG_COMPONENT_SCROLL_UP,
  55.     E_DIALOG_COMPONENT_SCROLL_DOWN,
  56.     E_DIALOG_COMPONENT_BUTTON1,
  57.     E_DIALOG_COMPONENT_BUTTON2,
  58.     E_DIALOG_COMPONENT_BUTTONC,
  59.     E_DIALOG_COMPONENT_MODEL[24],
  60.     E_DIALOG_COMPONENT_LABEL[24],
  61.     E_DIALOG_COMPONENT_BAR[24],
  62.     E_DIALOG_COMPONENT_SCROLL
  63. };
  64. new p_DialogCompnent[MAX_PLAYERS][E_DIALOG_COMPONENT];
  65.  
  66. stock Dialog_Create(playerid, Float:posX, Float:posY, string[], bgcolor, font, Float:lettersizeX, Float:lettersizeY, textcolor, allign = 0, outline = 1, proportional = 1, shadow = 1, usebox = 0, boxcolor = 0, Float:textsizeX = -1.0, Float:textsizeY = -1.0, model = 0, Float:rotX = 0.0, Float:rotY = 0.0, Float:rotZ = 0.0, Float:zoom = 1.0, selectable = 0, show = 0)
  67. {
  68.     p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]] = CreatePlayerTextDraw(playerid, posX, posY, string);
  69.  
  70.     PlayerTextDrawBackgroundColor(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], bgcolor);
  71.     PlayerTextDrawFont(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], font);
  72.     PlayerTextDrawLetterSize(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], lettersizeX, lettersizeY);
  73.     PlayerTextDrawColor(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], textcolor);
  74.     PlayerTextDrawAlignment(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], allign);
  75.     PlayerTextDrawSetOutline(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], outline);
  76.     PlayerTextDrawSetProportional(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], proportional);
  77.     PlayerTextDrawSetShadow(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], shadow);
  78.     PlayerTextDrawUseBox(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], usebox);
  79.     PlayerTextDrawSetSelectable(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], selectable);
  80.  
  81.     if (usebox)
  82.         PlayerTextDrawBoxColor(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], boxcolor);
  83.  
  84.     if (textsizeX != -1.0 || textsizeY != -1.0)
  85.         PlayerTextDrawTextSize(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], textsizeX, textsizeY);
  86.  
  87.     if(font == 5)
  88.     {
  89.         PlayerTextDrawSetPreviewModel(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], model);
  90.         PlayerTextDrawSetPreviewRot(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]], rotX, rotY, rotZ, zoom);
  91.     }
  92.  
  93.     if (show)
  94.         PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogTextDrawPool[playerid]]);
  95.  
  96.     p_DialogTextDrawPool[playerid]++;
  97.     return (p_DialogTextDrawPool[playerid] - 1);
  98. }
  99.  
  100. stock Dialog_Init(playerid, style, caption[], button1[], button2[])
  101. {
  102.     /*for (new i; i < DIALOG_MAX_TEXT_DRAWS; i++) {
  103.         if(p_DialogTextDraw[playerid][i] != PlayerText:INVALID_TEXT_DRAW)
  104.         PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][i]);
  105.         PlayerTextDrawDestroy(playerid, p_DialogTextDraw[playerid][i]);
  106.         p_DialogTextDraw[playerid][i] = PlayerText:INVALID_TEXT_DRAW;
  107.     }*/
  108.     Dialog_Exit(playerid);
  109.  
  110.     Dialog_Create(playerid, 173.000000, 122.000000, "_", 50, 1, 0.000000, 0.599999, -1, 0, 0, 1, 1, 1, 200, 462.000000, 19.000000, .show = 1);
  111.     Dialog_Create(playerid, 173.000000, 121.000000, caption, 50, 1, 0.129998, 0.799998, -36, 0, 0, 1, 1, 0, .show = 1);
  112.  
  113.     Dialog_Create(playerid, 173.000000, 131.000000, "_", 50, 1, 0.000000, 21.599998, -1, 0, 0, 1, 1, 1, 150, 462.000000, 19.000000, .show = 1);
  114.     Dialog_Create(playerid, 177.000000, 135.000000, "_", 50, 1, 0.000000, 18.299997, -1, 0, 0, 1, 1, 1, 100, 458.000000, 19.000000, .show = 1);
  115.     Dialog_Create(playerid, 177.000000, 134.000000, "_", 50, 1, 0.000000, 18.499998, -1, 0, 0, 1, 1, 1, -106, 173.000000, 19.000000, .show = 1);
  116.     Dialog_Create(playerid, 454.000000, 135.000000, "_", 50, 1, 0.000000, 18.299997, -1, 0, 0, 1, 1, 1, -106, 452.000000, 19.000000, .show = 1);
  117.     Dialog_Create(playerid, 461.000000, 135.000000, "_", 50, 1, 0.000000, 18.299997, -1, 0, 0, 1, 1, 1, -106, 459.000000, 19.000000, .show = 1);
  118.     Dialog_Create(playerid, 462.000000, 134.000000, "_", 50, 1, 0.000000, -0.300001, -1, 0, 0, 1, 1, 1, -106, 174.000000, 19.000000, .show = 1);
  119.     Dialog_Create(playerid, 462.000000, 304.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 173.000000, 19.000000, .show = 1);
  120.  
  121.     p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL_UP] = Dialog_Create(playerid, 453.000000, 133.000000, "LD_POOL:ball", 50, 4, 0.500000, 1.000000, -106, 0, 0, 1, 1, 1, 255, 7.000000, 9.00000, .selectable = 1, .show = 1);
  122.     Dialog_Create(playerid, 454.000000, 134.000000, "LD_BEAT:up", 255, 4, 0.500000, 1.000000, 255, 0, 0, 1, 1, 1, 255, 5.000000, 6.000000, .show = 1);
  123.  
  124.     p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL_DOWN] = Dialog_Create(playerid, 453.000000, 293.000000, "LD_POOL:ball", 50, 4, 0.500000, 1.000000, -106, 0, 0, 1, 1, 1, 255, 7.000000, 9.00000, .selectable = 1, .show = 1);
  125.     Dialog_Create(playerid, 454.000000, 295.000000, "LD_BEAT:down", 255, 4, 0.500000, 1.000000, 255, 0, 0, 1, 1, 1, 255, 5.000000, 6.000000, .show = 1);
  126.  
  127.     if (button2[0])
  128.     {
  129.         Dialog_Create(playerid, 302.000000, 310.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 253.000000, 19.000000, .show = 1);
  130.         Dialog_Create(playerid, 302.000000, 324.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 253.000000, 19.000000, .show = 1);
  131.         Dialog_Create(playerid, 253.000000, 304.000000, "(", 0, 1, 0.200000, 2.000000, -106, 0, 0, 1, 1, .show = 1);
  132.         Dialog_Create(playerid, 299.000000, 304.000000, ")", 0, 1, 0.200000, 2.000000, -106, 0, 0, 1, 1, .show = 1);
  133.         p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTON1] = Dialog_Create(playerid, 254.000000, 309.000000, "ld_plan:tvbase", 50, 4, 0.000000, 0.899998, 255, 0, 0, 1, 1, 1, 255, 46.000000, 13.000000, .selectable = 1, .show = 1);
  134.         Dialog_Create(playerid, 278.000000, 311.000000, button1, 50, 1, 0.129998, 0.799998, -36, 2, 0, 1, 1, 0, .show = 1);
  135.         if (!button1[0])
  136.             Dialog_Create(playerid, 278.000000, 311.000000, "button1", 50, 1, 0.129998, 0.799998, -36, 2, 0, 1, 1, 0, .show = 1);
  137.         else
  138.             Dialog_Create(playerid, 278.000000, 311.000000, button1, 50, 1, 0.129998, 0.799998, -36, 2, 0, 1, 1, 0, .show = 1);
  139.  
  140.         Dialog_Create(playerid, 372.000000, 310.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 323.000000, 19.000000, .show = 1);
  141.         Dialog_Create(playerid, 372.000000, 324.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 323.000000, 19.000000, .show = 1);
  142.         Dialog_Create(playerid, 323.000000, 304.000000, "(", 0, 1, 0.210000, 2.000000, -106, 0, 0, 1, 1, .show = 1);
  143.         Dialog_Create(playerid, 369.000000, 304.000000, ")", 0, 1, 0.230000, 1.999999, -106, 0, 0, 1, 1, .show = 1);
  144.         p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTON2] = Dialog_Create(playerid, 324.000000, 309.000000, "ld_plan:tvbase", 50, 4, 0.000000, 0.899998, 255, 0, 0, 1, 1, 1, 255, 46.000000, 13.000000, .selectable = 1, .show = 1);
  145.         Dialog_Create(playerid, 348.000000, 311.000000, button2, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0, .show = 1);
  146.     }
  147.     else
  148.     {
  149.         Dialog_Create(playerid, 342.000000, 310.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 293.000000, 19.000000, .show = 1);
  150.         Dialog_Create(playerid, 342.000000, 324.000000, "_", 50, 1, 0.000000, -0.400001, -1, 0, 0, 1, 1, 1, -106, 293.000000, 19.000000, .show = 1);
  151.         Dialog_Create(playerid, 293.000000, 304.000000, "(", 0, 1, 0.200000, 2.000000, -106, 0, 0, 1, 1, .show = 1);
  152.         Dialog_Create(playerid, 339.000000, 304.000000, ")", 0, 1, 0.219999, 2.000000, -106, 0, 0, 1, 1, .show = 1);
  153.         p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTONC] = Dialog_Create(playerid, 294.000000, 309.000000, "ld_plan:tvbase", 50, 4, 0.000000, 0.899998, 255, 0, 0, 1, 1, 1, 255, 46.000000, 13.000000, .selectable = 1, .show = 1);
  154.         if (!button1[0])
  155.             Dialog_Create(playerid, 317.000000, 311.000000, "button1", 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0, .show = 1);
  156.         else
  157.             Dialog_Create(playerid, 317.000000, 311.000000, button1, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0, .show = 1);
  158.     }
  159.  
  160.     if (style == DIALOG_STYLE_PREVMODEL)
  161.     {
  162.         new count;
  163.         new Float:base[2] = {179.000000, 134.000000};
  164.  
  165.         for (new i; i < 24; i++)
  166.         {
  167.             p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][i] = Dialog_Create(playerid, base[0], base[1], "_", Dialog_SetOpacity(0x3B3B3BFF, 200), 5, 0.129998, 0.799998, -1, 0, 0, 1, 1, 1, 0, 44.000000, 41.000000, .selectable = 1);
  168.             p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][i] = Dialog_Create(playerid, base[0] + 2.000000, base[1] + 1.000000, "", 255, 1, 0.140000, 0.899999, -36, 0, 0, 1, 2, 0);
  169.  
  170.             base[0] += 45.000000;
  171.  
  172.             count++;
  173.             if (count == 6)
  174.             {
  175.                 base[0] = 179.000000;
  176.                 base[1] += 42.000000;
  177.  
  178.                 count = 0;
  179.             }
  180.         }
  181.     }
  182.     else
  183.     {
  184.         for (new i; i < (5); i++)
  185.         {
  186.             p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][i] = Dialog_Create(playerid, 177.000000, (134.000000 + (33.0 * i)), "ld_plan:tvbase", 50, 4, 0.129997, 0.799997, Dialog_SetOpacity(0x788FB0FF, 200), 0, 0, 1, 1, 1, 0, 274.000000, 32.000000, .selectable = 1);
  187.             p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][i] = Dialog_Create(playerid, 178.000000, (134.000000 + (33.0 * i)), "_", Dialog_SetOpacity(0x3B3B3BFF, 200), 5, 0.129997, 0.799997, -1, 0, 0, 1, 1, 1, 0, 34.000000, 30.000000);
  188.             p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][i] = Dialog_Create(playerid, 215.000000, (135.000000 + (33.0 * i)), "", 255, 1, 0.099999, 0.599997, -36, 0, 0, 1, 2, 0);
  189.         }
  190.     }
  191.  
  192.     p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL] = Dialog_Create(playerid, 0.000000, 0.000000, "_", 0, 1, 0.0, 0.0, 0);
  193. }
  194.  
  195. stock Dialog_Exit(playerid)
  196. {
  197.     for (new i; i < DIALOG_MAX_TEXT_DRAWS; i++) {
  198.         if(p_DialogTextDraw[playerid][i] != PlayerText:INVALID_TEXT_DRAW) {
  199.             PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][i]);
  200.             PlayerTextDrawDestroy(playerid, p_DialogTextDraw[playerid][i]);
  201.             p_DialogTextDraw[playerid][i] = PlayerText:INVALID_TEXT_DRAW;
  202.         }
  203.     }
  204.  
  205.     p_DialogTextDrawPool[playerid] = 0;
  206. }
  207.  
  208. stock Dialog_GetListitem(playerid, listitem, &model, label[], &Float:x, &Float:y, &Float:z, &Float:zoom, &color1, &color2, maxlength = sizeof (label))
  209. {
  210.     new string[DIALOG_MAX_LISTITEM_SIZE];
  211.     format(string, sizeof (string), "DialogListitem_%i", listitem);
  212.     GetPVarString(playerid, string, string, DIALOG_MAX_LISTITEM_SIZE);
  213.  
  214.     new dest[(DIALOG_MAX_LISTITEM_SIZE / 2)];
  215.    
  216.     new type;
  217.     new pos;
  218.     for (new i; i < DIALOG_MAX_LISTITEM_SIZE; i++)
  219.     {
  220.         if (string[i] == '|' || i == (DIALOG_MAX_LISTITEM_SIZE - 1))
  221.         {
  222.             strmid(dest, string, pos, i);
  223.             pos = (i + 1);
  224.  
  225.             switch (type)
  226.             {
  227.                 case 0: model = strval(dest);
  228.                 case 1: format(label, maxlength, dest);
  229.                 case 2: x = floatstr(dest);
  230.                 case 3: y = floatstr(dest);
  231.                 case 4: z = floatstr(dest);
  232.                 case 5: zoom = floatstr(dest);
  233.                 case 6: color1 = strval(dest);
  234.                 case 7: color2 = strval(dest);
  235.             }
  236.             type++;
  237.         }
  238.     }
  239. }
  240.  
  241. stock Dialog_SetListitem(playerid, listitem, model, label[], Float:x, Float:y, Float:z, Float:zoom, color1, color2)
  242. {
  243.     new string[DIALOG_MAX_LISTITEM_SIZE];
  244.     format(string, DIALOG_MAX_LISTITEM_SIZE, "%i|%s|%f|%f|%f|%f|%i|%i", model, label, x, y, z, zoom, color1, color2);
  245.    
  246.     new varname[45];
  247.     format(varname, sizeof (varname), "DialogListitem_%i", listitem);
  248.     SetPVarString(playerid, varname, string);
  249. }
  250.  
  251. stock Dialog_SetPage(playerid, page)
  252. {
  253.     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  254.  
  255.     switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  256.     {
  257.         case DIALOG_STYLE_PREVMODEL:
  258.         {
  259.             PlayerTextDrawDestroy(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL]]);
  260.             p_DialogTextDrawPool[playerid]--;
  261.  
  262.             new pages = Dialog_CountPages(p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS], 24);
  263.             if (pages > 1)
  264.             {
  265.                 new Float:whiles = ((145.500000 + 16.200000) / pages);
  266.                 p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL] = Dialog_Create(playerid, 455.000000, (144.000000 + (whiles * page)), "_", 0, 1, 0.000000, (whiles / 16.200000), 0, .usebox = 1, .boxcolor = Dialog_SetOpacity(0xD15454FF, 200), .textsizeX = 458.000000, .textsizeY = 0.000000, .show = 1);
  267.             }
  268.  
  269.             new listitem, index, model, label[DIALOG_MAX_LISTITEM_SIZE / 2], Float:x, Float:y, Float:z, Float:zoom, color1, color2;
  270.             for (new i; i < 24; i++)
  271.             {
  272.                 listitem = ((page * 24) + i);
  273.                 if (listitem >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  274.                 {
  275.                     PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  276.                     PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]]);
  277.  
  278.                     index++;
  279.                     continue;
  280.                 }
  281.  
  282.                 Dialog_GetListitem(playerid, listitem, model, label, x, y, z, zoom, color1, color2);
  283.                 if (model < 0 || model > 20000)
  284.                     continue;
  285.  
  286.                 PlayerTextDrawBackgroundColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], Dialog_SetOpacity(0x3B3B3BFF, 150));
  287.                 PlayerTextDrawSetPreviewModel(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], model);
  288.                 PlayerTextDrawSetPreviewRot(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], x, y, z, zoom);
  289.                 PlayerTextDrawSetPreviewVehCol(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], color1, color2);
  290.                 PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  291.  
  292.                 if (label[0])
  293.                 {
  294.                     PlayerTextDrawSetString(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]], label);
  295.                     PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]]);
  296.                 }
  297.  
  298.                 index++;
  299.             }
  300.  
  301.             PlayerTextDrawBackgroundColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][0]], Dialog_SetOpacity(0xFF5959FF, 150));
  302.             PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][0]]);
  303.         }
  304.  
  305.         case DIALOG_STYLE_PREVMODEL_LIST:
  306.         {
  307.             PlayerTextDrawDestroy(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL]]);
  308.             p_DialogTextDrawPool[playerid]--;
  309.  
  310.             new pages = Dialog_CountPages(p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS], 5);
  311.             if (pages > 1)
  312.             {
  313.                 new Float:whiles = ((145.500000 + 16.200000) / pages);
  314.                 p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL] = Dialog_Create(playerid, 455.000000, (144.000000 + (whiles * page)), "_", 0, 1, 0.000000, (whiles / 16.200000), 0, .usebox = 1, .boxcolor = Dialog_SetOpacity(0xD15454FF, 200), .textsizeX = 458.000000, .textsizeY = 0.000000, .show = 1);
  315.             }
  316.  
  317.             new listitem, index, model, label[DIALOG_MAX_LISTITEM_SIZE / 2], Float:x, Float:y, Float:z, Float:zoom, color1, color2;
  318.             for (new i; i < 5; i++)
  319.             {
  320.                 listitem = ((page * 5) + i);
  321.                 if (listitem >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  322.                 {
  323.                     PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][index]]);
  324.                     PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  325.                     PlayerTextDrawHide(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]]);
  326.  
  327.                     index++;
  328.                     continue;
  329.                 }
  330.  
  331.                 Dialog_GetListitem(playerid, listitem, model, label, x, y, z, zoom, color1, color2);
  332.                 if (model < 0 || model > 20000)
  333.                     continue;
  334.  
  335.                 PlayerTextDrawColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][index]], Dialog_SetOpacity(0x788FB0FF, 200));
  336.                 PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][index]]);
  337.  
  338.                 PlayerTextDrawSetPreviewModel(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], model);
  339.                 PlayerTextDrawSetPreviewRot(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], x, y, z, zoom);
  340.                 PlayerTextDrawSetPreviewVehCol(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], color1, color2);
  341.                 PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  342.  
  343.                 if (label[0])
  344.                 {
  345.                     PlayerTextDrawSetString(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]], label);
  346.                     PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_LABEL][index]]);
  347.                 }
  348.  
  349.                 index++;
  350.             }
  351.  
  352.             PlayerTextDrawColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][0]], Dialog_SetOpacity(0xFF5959FF, 200));
  353.             PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][0]]);
  354.         }
  355.     }
  356. }
  357.  
  358. forward Dialog_HideForPlayer(playerid);
  359. public  Dialog_HideForPlayer(playerid)
  360. {
  361.     switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  362.     {
  363.         case DIALOG_STYLE_MSGBOX..DIALOG_STYLE_TABLIST_HEADERS:
  364.         {
  365.             ShowPlayerDialog(playerid, -1, 0, "", "", "", "");
  366.         }
  367.  
  368.         case DIALOG_STYLE_PREVMODEL,
  369.              DIALOG_STYLE_PREVMODEL_LIST:
  370.         {
  371.             Dialog_Exit(playerid);
  372.  
  373.             p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = true;
  374.             CancelSelectTextDraw(playerid);
  375.         }
  376.     }
  377.  
  378.     p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  379.     p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  380.     p_Dialog[playerid][E_PLAYER_DIALOG_DUAL_BTN] = false;
  381.     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS] = 0;
  382.     p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  383.     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  384.     p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = 0;
  385.  
  386.     return 1;
  387. }
  388.  
  389. stock Dialog_ShowToPlayer(playerid, dialogid, style, caption[], info[], button1[], button2[])
  390. {
  391.     if (playerid < 0 || playerid >= MAX_PLAYERS)
  392.         return 0;
  393.  
  394.     //CallRemoteFunction("Dialog_HideForPlayer", "i", playerid);
  395.     Dialog_HideForPlayer(playerid);
  396.  
  397.     p_Dialog[playerid][E_PLAYER_DIALOG_ID] = dialogid;
  398.     p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = style;
  399.  
  400.     switch (style)
  401.     {
  402.         case DIALOG_STYLE_PREVMODEL,
  403.              DIALOG_STYLE_PREVMODEL_LIST:
  404.         {
  405.             if (dialogid < 0)
  406.             {
  407.                 p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  408.                 p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  409.                 return 1;
  410.             }
  411.  
  412.             Dialog_Init(playerid, style, caption, button1, button2);
  413.  
  414.             new pos;
  415.             new str[5 + DIALOG_MAX_LISTITEM_SIZE];
  416.             new str_model[5];
  417.             new str_label[DIALOG_MAX_LISTITEM_SIZE / 2];
  418.  
  419.             for (new i, j = strlen(info); i < j; i++)
  420.             {
  421.                 if (info[i] == '\n')
  422.                 {
  423.                     strmid(str, info, pos, i);
  424.                     pos = (i + 1);
  425.                 }
  426.                 else if (i == (j - 1))
  427.                 {
  428.                     strmid(str, info, pos, j);
  429.                 }
  430.                 else continue;
  431.  
  432.                 for (new x, y = strlen(str); x < y; x++)
  433.                 {
  434.                     if (str[x] == '\t')
  435.                     {
  436.                         strmid(str_model, str, 0, x);
  437.                         strmid(str_label, str, (x + 1), y);
  438.                         break;
  439.                     }
  440.                     else if (x == (y - 1))
  441.                     {
  442.                         strmid(str_model, str, 0, y);
  443.                         str_label[0] = EOS;
  444.                         break;
  445.                     }
  446.                 }
  447.  
  448.                 Dialog_SetListitem(playerid, (p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS]++), strval(str_model), str_label, 0.0, 0.0, 0.0, 1.0, -1, -1);
  449.             }
  450.  
  451.             p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  452.             p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  453.  
  454.             Dialog_SetPage(playerid, 0);
  455.             SelectTextDraw(playerid, Dialog_SetOpacity(0xD15454FF, 200));
  456.         }
  457.  
  458.         default: ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  459.     }
  460.  
  461.     return 1;
  462. }
  463. #if defined _ALS_ShowPlayerDialog
  464.     #undef ShowPlayerDialog
  465. #else
  466.     #define _ALS_ShowPlayerDialog
  467. #endif
  468. #define ShowPlayerDialog Dialog_ShowToPlayer
  469.  
  470. stock ShowPlayerPreviewModelDialog(playerid, dialogid, style, caption[], models[], labels[][], button1[], button2[], limit = sizeof (models), limit2 = sizeof (labels))
  471. {
  472.     if (playerid < 0 || playerid >= MAX_PLAYERS)
  473.         return 0;
  474.  
  475.     //CallRemoteFunction("Dialog_HideForPlayer", "i", playerid);
  476.     Dialog_HideForPlayer(playerid);
  477.  
  478.     if (dialogid < 0)
  479.         return 1;
  480.  
  481.     switch (style)
  482.     {
  483.         case DIALOG_STYLE_PREVMODEL,
  484.              DIALOG_STYLE_PREVMODEL_LIST:
  485.         {
  486.         }
  487.  
  488.         default:
  489.             return 0;
  490.     }
  491.  
  492.     p_Dialog[playerid][E_PLAYER_DIALOG_ID] = dialogid;
  493.     p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = style;
  494.  
  495.     Dialog_Init(playerid, style, caption, button1, button2);
  496.  
  497.     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS]= limit;
  498.     for (new i; i < limit; i++)
  499.         Dialog_SetListitem(playerid, i, models[i], ((i >= limit2) ? ("") : (labels[i])), 0.0, 0.0, 0.0, 1.0, -1, -1);
  500.  
  501.     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  502.     p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  503.  
  504.     Dialog_SetPage(playerid, 0);
  505.     SelectTextDraw(playerid, Dialog_SetOpacity(0xD15454FF, 200));
  506.  
  507.     return true;
  508. }
  509.  
  510. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  511. {
  512.     if (!p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED])
  513.     {
  514.         switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  515.         {
  516.             case DIALOG_STYLE_PREVMODEL,
  517.                  DIALOG_STYLE_PREVMODEL_LIST:
  518.             {
  519.                 if (clickedid == Text:INVALID_TEXT_DRAW)
  520.                 {
  521.                     Dialog_Exit(playerid);
  522.                     p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = true;
  523.                     CancelSelectTextDraw(playerid);
  524.  
  525.                     new diagid = p_Dialog[playerid][E_PLAYER_DIALOG_ID], listid = p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID];
  526.  
  527.                     p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  528.                     p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  529.                     p_Dialog[playerid][E_PLAYER_DIALOG_DUAL_BTN] = false;
  530.                     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS] = 0;
  531.                     p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  532.                     p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  533.                     p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = 0;
  534.                     if (funcidx("OnDialogResponse") != -1)
  535.                         CallLocalFunction("OnDialogResponse", "iiiis", playerid, diagid, 0, listid, "\1");
  536.                 }
  537.                 return 1;
  538.             }
  539.         }
  540.     }
  541.  
  542.     p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = false;
  543.     return CallLocalFunction("Dialog_OnPlayerClickTextDraw", "ii", playerid, _:clickedid);
  544.     /*#if defined Dialog_OnPlayerClickTextDraw
  545.         return Dialog_OnPlayerClickTextDraw(playerid, clickedid);
  546.     #else
  547.         return 0;
  548.     #endif */
  549. }
  550. #if defined _ALS_OnPlayerClickTextDraw
  551.     #undef OnPlayerClickTextDraw
  552. #else
  553.     #define _ALS_OnPlayerClickTextDraw
  554. #endif
  555. #define OnPlayerClickTextDraw Dialog_OnPlayerClickTextDraw
  556. #if defined Dialog_OnPlayerClickTextDraw
  557.     forward Dialog_OnPlayerClickTextDraw(playerid, Text:clickedid);
  558. #endif
  559.  
  560. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  561. {
  562.     switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  563.     {
  564.         case DIALOG_STYLE_PREVMODEL,DIALOG_STYLE_PREVMODEL_LIST:
  565.         {
  566.             if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTON2]])
  567.             {
  568.                 Dialog_Exit(playerid);
  569.                 p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = true;
  570.                 CancelSelectTextDraw(playerid);
  571.  
  572.                 new diagid = p_Dialog[playerid][E_PLAYER_DIALOG_ID], listid = p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID];
  573.  
  574.                 p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  575.                 p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  576.                 p_Dialog[playerid][E_PLAYER_DIALOG_DUAL_BTN] = false;
  577.                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS] = 0;
  578.                 p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  579.                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  580.                 p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = 0;
  581.  
  582.                 CallLocalFunction("OnDialogResponse", "iiiis", playerid, diagid, 0, listid, "\1");
  583.             }
  584.             else if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTON1]] || playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BUTTONC]])
  585.             {
  586.                 Dialog_Exit(playerid);
  587.                 p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = true;
  588.                 CancelSelectTextDraw(playerid);
  589.  
  590.                 new diagid = p_Dialog[playerid][E_PLAYER_DIALOG_ID], listid = p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID];
  591.  
  592.                 p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  593.                 p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  594.                 p_Dialog[playerid][E_PLAYER_DIALOG_DUAL_BTN] = false;
  595.                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS] = 0;
  596.                 p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  597.                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  598.                 p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = 0;
  599.  
  600.                 CallLocalFunction("OnDialogResponse", "iiiis", playerid, diagid, 1, listid, "\1");
  601.             }
  602.             else if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL_UP]])
  603.             {
  604.                 if ((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] - 1) < 0)
  605.                     PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
  606.                 else
  607.                     Dialog_SetPage(playerid, (--p_Dialog[playerid][E_PLAYER_DIALOG_PAGE]));
  608.             }
  609.             else if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_SCROLL_DOWN]])
  610.             {
  611.                 if ((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] + 1) >= Dialog_CountPages(p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS], ((p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] == DIALOG_STYLE_PREVMODEL) ? (24) : (5))))
  612.                     PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
  613.                 else
  614.                     Dialog_SetPage(playerid, (++p_Dialog[playerid][E_PLAYER_DIALOG_PAGE]));
  615.             }
  616.             else
  617.             {
  618.                 new index = -1;
  619.                 switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  620.                 {
  621.                     case DIALOG_STYLE_PREVMODEL:
  622.                     {
  623.                         new listitem;
  624.                         for (new i; i < 24; i++)
  625.                         {
  626.                             listitem = ((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] * 24) + i);
  627.                             if (listitem >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  628.                                 break;
  629.  
  630.                             if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][i]])
  631.                             {
  632.                                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = listitem;
  633.                                 index = i;
  634.                                 break;
  635.                             }
  636.                         }
  637.                     }
  638.  
  639.                     case DIALOG_STYLE_PREVMODEL_LIST:
  640.                     {
  641.                         new listitem;
  642.                         for (new i; i < 5; i++)
  643.                         {
  644.                             listitem = ((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] * 5) + i);
  645.                             if (listitem >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  646.                                 break;
  647.  
  648.                             if (playertextid == p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][i]])
  649.                             {
  650.                                 p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = listitem;
  651.                                 index = i;
  652.                                 break;
  653.                             }
  654.                         }
  655.                     }
  656.                 }
  657.  
  658.                 if (index != -1)
  659.                 {
  660.                     if (GetTickCount() - p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] <= 200)
  661.                     {
  662.                         Dialog_Exit(playerid);
  663.                         p_Dialog[playerid][E_PLAYER_DIALOG_CANCELED] = true;
  664.                         CancelSelectTextDraw(playerid);
  665.  
  666.                         new diagid = p_Dialog[playerid][E_PLAYER_DIALOG_ID], listid = p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID];
  667.  
  668.                         p_Dialog[playerid][E_PLAYER_DIALOG_ID] = -1;
  669.                         p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] = -1;
  670.                         p_Dialog[playerid][E_PLAYER_DIALOG_DUAL_BTN] = false;
  671.                         p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS] = 0;
  672.                         p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] = 0;
  673.                         p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEM_ID] = 0;
  674.                         p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = 0;
  675.  
  676.                         CallLocalFunction("OnDialogResponse", "iiiis", playerid, diagid, 1, listid, "\1");
  677.                     }
  678.                     else
  679.                     {
  680.                         switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  681.                         {
  682.                             case DIALOG_STYLE_PREVMODEL:
  683.                             {
  684.                                 for (new i; i < 24; i++)
  685.                                 {
  686.                                     if (((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] * 24) + i) >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  687.                                         break;
  688.  
  689.                                     PlayerTextDrawBackgroundColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][i]], Dialog_SetOpacity(0x3B3B3BFF, 150));
  690.                                     PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][i]]);
  691.                                 }
  692.                                 PlayerTextDrawBackgroundColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], Dialog_SetOpacity(0xFF5959FF, 150));
  693.                                 PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  694.                             }
  695.  
  696.                             case DIALOG_STYLE_PREVMODEL_LIST:
  697.                             {
  698.                                 for (new i; i < 5; i++)
  699.                                 {
  700.                                     if (((p_Dialog[playerid][E_PLAYER_DIALOG_PAGE] * 5) + i) >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  701.                                         break;
  702.  
  703.                                     PlayerTextDrawColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][i]], Dialog_SetOpacity(0x788FB0FF, 200));
  704.                                     PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][i]]);
  705.                                 }
  706.                                 PlayerTextDrawColor(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][index]], Dialog_SetOpacity(0xFF5959FF, 200));
  707.                                 PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_BAR][index]]);
  708.                             }
  709.                         }
  710.  
  711.                         p_Dialog[playerid][E_PLAYER_DIALOG_CLICK_TICKCOUNT] = GetTickCount();
  712.                     }
  713.                 }
  714.             }
  715.  
  716.             return 1;
  717.         }
  718.     }
  719.     return CallLocalFunction("Dialog_OnPlayerClickPlayerTD", "ii", playerid, _:playertextid);
  720.     /*#if defined Dialog_OnPlayerClickPlayerTD
  721.         return Dialog_OnPlayerClickPlayerTD(playerid, playertextid);
  722.     #else
  723.         return 0;
  724.     #endif */
  725. }
  726. #if defined _ALS_OnPlayerClickPlayerTD
  727.     #undef OnPlayerClickPlayerTextDraw
  728. #else
  729.     #define _ALS_OnPlayerClickPlayerTD
  730. #endif
  731. #define OnPlayerClickPlayerTextDraw Dialog_OnPlayerClickPlayerTD
  732. #if defined Dialog_OnPlayerClickPlayerTD
  733.     forward Dialog_OnPlayerClickPlayerTD(playerid, PlayerText:playertextid);
  734. #endif
  735.  
  736. stock Dialog_SetListModelRotation(playerid, listitem, Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:zoom = 1.0, color1 = -1, color2 = -1)
  737. {
  738.     if (playerid < 0 || playerid >= MAX_PLAYERS)
  739.         return 0;
  740.  
  741.     if (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] == -1)
  742.         return 0;
  743.  
  744.     new index;
  745.     switch (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE])
  746.     {
  747.         case DIALOG_STYLE_PREVMODEL,
  748.              DIALOG_STYLE_PREVMODEL_LIST:
  749.         {
  750.             if (listitem >= p_Dialog[playerid][E_PLAYER_DIALOG_LISTITEMS])
  751.                 return 0;
  752.  
  753.             if (p_Dialog[playerid][E_PLAYER_DIALOG_STYLE] == DIALOG_STYLE_PREVMODEL)
  754.                 index = listitem - (floatround(Float:(listitem - 24), floatround_floor) * 24);
  755.             else
  756.                 index = listitem - (floatround(Float:(listitem - 5), floatround_floor) * 5);
  757.  
  758.             p_DialogModelRot[playerid][listitem][0] = x;
  759.             p_DialogModelRot[playerid][listitem][1] = y;
  760.             p_DialogModelRot[playerid][listitem][2] = z;
  761.             p_DialogModelRot[playerid][listitem][3] = zoom;
  762.             p_DialogModelVehCol[playerid][listitem][0] = color1;
  763.             p_DialogModelVehCol[playerid][listitem][1] = color2;
  764.  
  765.             PlayerTextDrawSetPreviewRot(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], x, y, z, zoom);
  766.             PlayerTextDrawSetPreviewVehCol(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]], color1, color2);
  767.             PlayerTextDrawShow(playerid, p_DialogTextDraw[playerid][p_DialogCompnent[playerid][E_DIALOG_COMPONENT_MODEL][index]]);
  768.         }
  769.  
  770.         default:
  771.             return 0;
  772.     }
  773.  
  774.     return 1;
  775. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement