SHARE
TWEET

Alternative Dialogs

a guest Dec 16th, 2017 277 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Alternative Dialogs by Nexius v5.5
  2.  
  3. #if defined _alt_dialogs_included
  4.     #endinput
  5. #endif
  6. #define _alt_dialogs_included
  7.  
  8. #include <a_samp>
  9.  
  10. #define AD_VERSION                      "5.5"
  11.  
  12. #define AD_STYLE_LIST                   2
  13.  
  14. #define FAST_DOUBLE_CLICK
  15.  
  16. #if defined FAST_DOUBLE_CLICK
  17.     #define MAX_CLICK_INTERVAL          250
  18. #endif
  19.  
  20. #if defined AD_SKIN_1
  21.     #define AD_SELECTION_COLOR              -10
  22.     #define AD_TITLE_COLOR                  -75
  23.     #define AD_CLOSE_BUTTON_COLOR           -75
  24.     #define AD_BUTTONS_COLOR                -75
  25.     #define AD_UP_DOWN_BUTTONS_COLOR        -75
  26.     #define AD_ITEMS_COLOR                  -75
  27.  
  28.     #define AD_TITLE_BOX_COLOR              200
  29.     #define AD_PANEL_BOX_COLOR              135
  30.     #define AD_CLOSE_BUTTON_BOX_COLOR       -16777156
  31.     #define AD_BUTTONS_BOX_COLOR            80
  32.     #define AD_SCROLL_BOX_COLOR             -16777170
  33.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    70
  34.     #define AD_ITEMS_BOX_COLOR              20
  35.  
  36.     #define AD_SELECTED_ITEM_BOX_COLOR      -16777180
  37.  
  38. #elseif defined AD_SKIN_2
  39.     #define AD_SELECTION_COLOR              -10
  40.     #define AD_TITLE_COLOR                  -75
  41.     #define AD_CLOSE_BUTTON_COLOR           -75
  42.     #define AD_BUTTONS_COLOR                -75
  43.     #define AD_UP_DOWN_BUTTONS_COLOR        -75
  44.     #define AD_ITEMS_COLOR                  -75
  45.  
  46.     #define AD_TITLE_BOX_COLOR              200
  47.     #define AD_PANEL_BOX_COLOR              135
  48.     #define AD_CLOSE_BUTTON_BOX_COLOR       -6291346
  49.     #define AD_BUTTONS_BOX_COLOR            100
  50.     #define AD_SCROLL_BOX_COLOR             -6291370
  51.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    90
  52.     #define AD_ITEMS_BOX_COLOR              40
  53.  
  54.     #define AD_SELECTED_ITEM_BOX_COLOR      -6291380
  55.  
  56. #elseif defined AD_SKIN_3
  57.     #define AD_SELECTION_COLOR              -10
  58.     #define AD_TITLE_COLOR                  -75
  59.     #define AD_CLOSE_BUTTON_COLOR           -75
  60.     #define AD_BUTTONS_COLOR                -75
  61.     #define AD_UP_DOWN_BUTTONS_COLOR        -75
  62.     #define AD_ITEMS_COLOR                  -75
  63.  
  64.     #define AD_TITLE_BOX_COLOR              190
  65.     #define AD_PANEL_BOX_COLOR              135
  66.     #define AD_CLOSE_BUTTON_BOX_COLOR       4652900
  67.     #define AD_BUTTONS_BOX_COLOR            90
  68.     #define AD_SCROLL_BOX_COLOR             4652875
  69.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    80
  70.     #define AD_ITEMS_BOX_COLOR              30
  71.  
  72.     #define AD_SELECTED_ITEM_BOX_COLOR      4652850
  73.  
  74. #elseif defined AD_SKIN_4
  75.     #define AD_SELECTION_COLOR              50
  76.     #define AD_TITLE_COLOR                  100
  77.     #define AD_CLOSE_BUTTON_COLOR           100
  78.     #define AD_BUTTONS_COLOR                100
  79.     #define AD_UP_DOWN_BUTTONS_COLOR        100
  80.     #define AD_ITEMS_COLOR                  100
  81.  
  82.     #define AD_TITLE_BOX_COLOR              -80
  83.     #define AD_PANEL_BOX_COLOR              -165
  84.     #define AD_CLOSE_BUTTON_BOX_COLOR       -6291346
  85.     #define AD_BUTTONS_BOX_COLOR            -110
  86.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    -90
  87.     #define AD_ITEMS_BOX_COLOR              -425
  88.     #define AD_SCROLL_BOX_COLOR             -6291370
  89.  
  90.     #define AD_SELECTED_ITEM_BOX_COLOR      -6291380
  91.  
  92. #elseif defined AD_SKIN_5
  93.     #define AD_SELECTION_COLOR              50
  94.     #define AD_TITLE_COLOR                  100
  95.     #define AD_CLOSE_BUTTON_COLOR           100
  96.     #define AD_BUTTONS_COLOR                100
  97.     #define AD_UP_DOWN_BUTTONS_COLOR        100
  98.     #define AD_ITEMS_COLOR                  100
  99.  
  100.     #define AD_TITLE_BOX_COLOR              -90
  101.     #define AD_PANEL_BOX_COLOR              -165
  102.     #define AD_CLOSE_BUTTON_BOX_COLOR       4652900
  103.     #define AD_BUTTONS_BOX_COLOR            -120
  104.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    -100
  105.     #define AD_ITEMS_BOX_COLOR              -435
  106.     #define AD_SCROLL_BOX_COLOR             4652875
  107.  
  108.     #define AD_SELECTED_ITEM_BOX_COLOR      4652850
  109.  
  110. #else
  111.     #define AD_SELECTION_COLOR              -10
  112.     #define AD_TITLE_COLOR                  -75
  113.     #define AD_CLOSE_BUTTON_COLOR           -75
  114.     #define AD_BUTTONS_COLOR                -75
  115.     #define AD_UP_DOWN_BUTTONS_COLOR        -75
  116.     #define AD_ITEMS_COLOR                  -75
  117.  
  118.     #define AD_TITLE_BOX_COLOR              110
  119.     #define AD_PANEL_BOX_COLOR              70
  120.     #define AD_CLOSE_BUTTON_BOX_COLOR       -16777156
  121.     #define AD_BUTTONS_BOX_COLOR            50
  122.     #define AD_SCROLL_BOX_COLOR             35
  123.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    25
  124.     #define AD_ITEMS_BOX_COLOR              15
  125.  
  126.     #define AD_SELECTED_ITEM_BOX_COLOR      35
  127. #endif
  128.  
  129. #define AD_MAX_DIALOG_PAGES             3   //Change if you want
  130. #define AD_MAX_CAPTION_LENGTH           38
  131. #define AD_MAX_ITEM_LENGTH              40
  132. #define AD_MAX_BUTTONS_LENGTH           6
  133.  
  134. #define AD_INVALID_ID                   -1
  135.  
  136. static
  137.     adItemID[MAX_PLAYERS],
  138.     adPageID[MAX_PLAYERS],
  139.     adDialogID[MAX_PLAYERS],
  140.     adMaxItems[MAX_PLAYERS],
  141.     bool:adIgnoreEsc[MAX_PLAYERS],
  142.     #if defined FAST_DOUBLE_CLICK
  143.         adLastClicked[MAX_PLAYERS],
  144.     #endif
  145.  
  146.     Text:adArrayTDs[11] = {Text:65535, ...},
  147.     PlayerText:adArrayPTDs[MAX_PLAYERS][21],
  148.  
  149.     adItems[MAX_PLAYERS][AD_MAX_DIALOG_PAGES * 8][AD_MAX_ITEM_LENGTH char];
  150.  
  151. forward OnAltDialogResponse(playerid, dialogid, response, listitem);
  152.  
  153. //To unlock the Easter egg, uncomment the next line...
  154. //#define EASTER_EGG_WHITE_STYLE
  155.  
  156. #if defined EASTER_EGG_WHITE_STYLE
  157.     #undef AD_SELECTION_COLOR
  158.     #define AD_SELECTION_COLOR              50
  159.     #undef AD_TITLE_COLOR
  160.     #define AD_TITLE_COLOR                  100
  161.     #undef AD_CLOSE_BUTTON_COLOR
  162.     #define AD_CLOSE_BUTTON_COLOR           100
  163.     #undef AD_BUTTONS_COLOR
  164.     #define AD_BUTTONS_COLOR                100
  165.     #undef AD_UP_DOWN_BUTTONS_COLOR
  166.     #define AD_UP_DOWN_BUTTONS_COLOR        100
  167.     #undef AD_ITEMS_COLOR
  168.     #define AD_ITEMS_COLOR                  100
  169.  
  170.     #undef AD_TITLE_BOX_COLOR
  171.     #define AD_TITLE_BOX_COLOR              -170
  172.     #undef AD_PANEL_BOX_COLOR
  173.     #define AD_PANEL_BOX_COLOR              -165
  174.     #undef AD_CLOSE_BUTTON_BOX_COLOR
  175.     #define AD_CLOSE_BUTTON_BOX_COLOR       -16777156
  176.     #undef AD_BUTTONS_BOX_COLOR
  177.     #define AD_BUTTONS_BOX_COLOR            -160
  178.     #undef AD_UP_DOWN_BUTTONS_BOX_COLOR
  179.     #define AD_UP_DOWN_BUTTONS_BOX_COLOR    -155
  180.     #undef AD_ITEMS_BOX_COLOR
  181.     #define AD_ITEMS_BOX_COLOR              -450
  182.     #undef AD_SCROLL_BOX_COLOR
  183.     #define AD_SCROLL_BOX_COLOR             -125
  184.  
  185.     #undef AD_SELECTED_ITEM_BOX_COLOR
  186.     #define AD_SELECTED_ITEM_BOX_COLOR      -80
  187. #endif
  188.  
  189. #if defined _inc_y_hooks || defined _INC_y_hooks
  190.     hook OnGameModeInit()
  191. #else
  192.     public OnGameModeInit()
  193. #endif
  194. {
  195.     adArrayTDs[0] = TextDrawCreate(470.0, 140.0, "_"); //Title box
  196.     TextDrawTextSize(adArrayTDs[0], 175.0, 0.0);
  197.     TextDrawLetterSize(adArrayTDs[0], 0.0, 1.3);
  198.     TextDrawUseBox(adArrayTDs[0], 1);
  199.     TextDrawBoxColor(adArrayTDs[0], AD_TITLE_BOX_COLOR);
  200.     #undef AD_TITLE_BOX_COLOR
  201.  
  202.     adArrayTDs[1] = TextDrawCreate(470.0, 155.0, "_"); //Panel box
  203.     TextDrawTextSize(adArrayTDs[1], 175.0, 0.0);
  204.     TextDrawLetterSize(adArrayTDs[1], 0.0, 17.1);
  205.     TextDrawUseBox(adArrayTDs[1], 1);
  206.     TextDrawBoxColor(adArrayTDs[1], AD_PANEL_BOX_COLOR);
  207.     #undef AD_PANEL_BOX_COLOR
  208.  
  209.     adArrayTDs[2] = TextDrawCreate(470.0, 140.0, "_"); //Close button box
  210.     TextDrawTextSize(adArrayTDs[2], 446.0, 12.0);
  211.     TextDrawLetterSize(adArrayTDs[2], 0.0, 1.3);
  212.     TextDrawUseBox(adArrayTDs[2], 1);
  213.     TextDrawBoxColor(adArrayTDs[2], AD_CLOSE_BUTTON_BOX_COLOR);
  214.     #undef AD_CLOSE_BUTTON_BOX_COLOR
  215.  
  216.     adArrayTDs[3] = TextDrawCreate(314.0, 290.5, "_"); //Button 1 box
  217.     TextDrawTextSize(adArrayTDs[3], 264.0, 12.0);
  218.     TextDrawLetterSize(adArrayTDs[3], 0.0, 1.3);
  219.     TextDrawUseBox(adArrayTDs[3], 1);
  220.     TextDrawBoxColor(adArrayTDs[3], AD_BUTTONS_BOX_COLOR);
  221.  
  222.     adArrayTDs[4] = TextDrawCreate(376.0, 290.5, "_"); //Button 2 box
  223.     TextDrawTextSize(adArrayTDs[4], 325.0, 12.0);
  224.     TextDrawLetterSize(adArrayTDs[4], 0.0, 1.3);
  225.     TextDrawUseBox(adArrayTDs[4], 1);
  226.     TextDrawBoxColor(adArrayTDs[4], AD_BUTTONS_BOX_COLOR);
  227.  
  228.     adArrayTDs[5] = TextDrawCreate(346.0, 290.5, "_"); //Button 1 box only
  229.     TextDrawTextSize(adArrayTDs[5], 296.0, 12.0);
  230.     TextDrawLetterSize(adArrayTDs[5], 0.0, 1.3);
  231.     TextDrawUseBox(adArrayTDs[5], 1);
  232.     TextDrawBoxColor(adArrayTDs[5], AD_BUTTONS_BOX_COLOR);
  233.     #undef AD_BUTTONS_BOX_COLOR
  234.  
  235.     adArrayTDs[6] = TextDrawCreate(470.0, 155.0, "_"); //Up button box
  236.     TextDrawTextSize(adArrayTDs[6], 460.0, 5.0);
  237.     TextDrawLetterSize(adArrayTDs[6], 0.0, 1.3);
  238.     TextDrawUseBox(adArrayTDs[6], 1);
  239.     TextDrawBoxColor(adArrayTDs[6], AD_UP_DOWN_BUTTONS_BOX_COLOR);
  240.  
  241.     adArrayTDs[7] = TextDrawCreate(470.0, 262.0, "_"); //Down button box
  242.     TextDrawTextSize(adArrayTDs[7], 460.0, 5.0);
  243.     TextDrawLetterSize(adArrayTDs[7], 0.0, 1.3);
  244.     TextDrawUseBox(adArrayTDs[7], 1);
  245.     TextDrawBoxColor(adArrayTDs[7], AD_UP_DOWN_BUTTONS_BOX_COLOR);
  246.     #undef AD_UP_DOWN_BUTTONS_BOX_COLOR
  247.  
  248.     adArrayTDs[8] = TextDrawCreate(454.0, 141.0, "X"); //Close button
  249.     TextDrawFont(adArrayTDs[8], 2);
  250.     TextDrawTextSize(adArrayTDs[8], 465.0, 12.0);
  251.     TextDrawLetterSize(adArrayTDs[8], 0.27, 0.9);
  252.     TextDrawColor(adArrayTDs[8], AD_CLOSE_BUTTON_COLOR);
  253.     #undef AD_CLOSE_BUTTON_COLOR
  254.     TextDrawSetShadow(adArrayTDs[8], 0);
  255.     TextDrawSetSelectable(adArrayTDs[8], 1);
  256.  
  257.     adArrayTDs[9] = TextDrawCreate(462.3, 165.0, "v"); //Up button
  258.     TextDrawFont(adArrayTDs[9], 2);
  259.     TextDrawTextSize(adArrayTDs[9], 471.0, 4.5);
  260.     TextDrawLetterSize(adArrayTDs[9], 0.18, -0.8);
  261.     TextDrawColor(adArrayTDs[9], AD_UP_DOWN_BUTTONS_COLOR);
  262.     TextDrawSetShadow(adArrayTDs[9], 0);
  263.     TextDrawSetSelectable(adArrayTDs[9], 1);
  264.  
  265.     adArrayTDs[10] = TextDrawCreate(462.3, 264.0, "v"); //Down button
  266.     TextDrawFont(adArrayTDs[10], 2);
  267.     TextDrawTextSize(adArrayTDs[10], 471.0, 4.5);
  268.     TextDrawLetterSize(adArrayTDs[10], 0.18, 0.8);
  269.     TextDrawColor(adArrayTDs[10], AD_UP_DOWN_BUTTONS_COLOR);
  270.     #undef AD_UP_DOWN_BUTTONS_COLOR
  271.     TextDrawSetShadow(adArrayTDs[10], 0);
  272.     TextDrawSetSelectable(adArrayTDs[10], 1);
  273.  
  274.     printf("Alternative Dialogs v%s by Nexius loaded!\n", AD_VERSION);
  275.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  276.         && defined ad_OnGameModeInit
  277.         return ad_OnGameModeInit();
  278.     #else
  279.         return 1;
  280.     #endif
  281. }
  282.  
  283. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  284.     #if defined _ALS_OnGameModeInit
  285.         #undef OnGameModeInit
  286.     #else
  287.         #define _ALS_OnGameModeInit
  288.     #endif
  289.     #define OnGameModeInit ad_OnGameModeInit
  290.     #if defined ad_OnGameModeInit
  291.         forward ad_OnGameModeInit();
  292.     #endif
  293. #endif
  294.  
  295. #if defined _inc_y_hooks || defined _INC_y_hooks
  296.     hook OnGameModeExit()
  297. #else
  298.     public OnGameModeExit()
  299. #endif
  300. {
  301.     for(new i = sizeof(adArrayTDs) - 1; i > -1; --i) TextDrawDestroy(adArrayTDs[i]);
  302.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  303.         && defined ad_OnGameModeExit
  304.         return ad_OnGameModeExit();
  305.     #else
  306.         return 1;
  307.     #endif
  308. }
  309.  
  310. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  311.     #if defined _ALS_OnGameModeExit
  312.         #undef OnGameModeExit
  313.     #else
  314.         #define _ALS_OnGameModeExit
  315.     #endif
  316.     #define OnGameModeExit ad_OnGameModeExit
  317.     #if defined ad_OnGameModeExit
  318.         forward ad_OnGameModeExit();
  319.     #endif
  320. #endif
  321.  
  322. #if defined _inc_y_hooks || defined _INC_y_hooks
  323.     hook OnPlayerConnect(playerid)
  324. #else
  325.     public OnPlayerConnect(playerid)
  326. #endif
  327. {
  328.     adIgnoreEsc[playerid] = false;
  329.     adDialogID[playerid] = AD_INVALID_ID;
  330.     for(new i = sizeof(adArrayPTDs[]) - 1; i > -1; --i) adArrayPTDs[playerid][i] = PlayerText:65535;
  331.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  332.         && defined ad_OnPlayerConnect
  333.         return ad_OnPlayerConnect(playerid);
  334.     #else
  335.         return 1;
  336.     #endif
  337. }
  338.  
  339. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  340.     #if defined _ALS_OnPlayerConnect
  341.         #undef OnPlayerConnect
  342.     #else
  343.         #define _ALS_OnPlayerConnect
  344.     #endif
  345.     #define OnPlayerConnect ad_OnPlayerConnect
  346.     #if defined ad_OnPlayerConnect
  347.         forward ad_OnPlayerConnect(playerid);
  348.     #endif
  349. #endif
  350.  
  351. #if defined _inc_y_hooks || defined _INC_y_hooks
  352.     hook OnPlayerClickTextDraw(playerid, Text:clickedid)
  353. #else
  354.     public OnPlayerClickTextDraw(playerid, Text:clickedid)
  355. #endif
  356. {
  357.     if(adIgnoreEsc[playerid] && clickedid == Text:65535) adIgnoreEsc[playerid] = false;
  358.     else if(adDialogID[playerid] != AD_INVALID_ID)
  359.     {
  360.         if(clickedid == Text:65535 || clickedid == adArrayTDs[8])
  361.         {
  362.             new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  363.             ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  364.             CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 2, tmp_itemid);
  365.         }
  366.         else if(clickedid == adArrayTDs[9])
  367.         {
  368.             if(adPageID[playerid] > 0)
  369.             {
  370.                 new i, Float:ssize, Float:spos;
  371.                 adPageID[playerid]--;
  372.                 adItemID[playerid] = adPageID[playerid] * 8;
  373.                 for(i = 11; i > 4; --i)
  374.                 {
  375.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][i], AD_ITEMS_BOX_COLOR);
  376.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][i]);
  377.                 }
  378.                 PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][4], AD_SELECTED_ITEM_BOX_COLOR);
  379.                 PlayerTextDrawShow(playerid, adArrayPTDs[playerid][4]);
  380.                 i = adPageID[playerid] * 8;
  381.                 for(new j = i + 8, c; i < j; i++)
  382.                 {
  383.                     PlayerTextDrawSetString(playerid, adArrayPTDs[playerid][12 + c], adItems[playerid][i]);
  384.                     if(!adItems[playerid][i]{0}) PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][12 + c], 0);
  385.                     else PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][12 + c], 1);
  386.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][12 + c]);
  387.                     c++;
  388.                 }
  389.                 PlayerTextDrawDestroy(playerid, adArrayPTDs[playerid][20]);
  390.                 ssize = 9.8 / (floatround(adMaxItems[playerid] / 8, floatround_tozero) + 1);
  391.                 spos = (ssize * 9) * adPageID[playerid];
  392.                 adArrayPTDs[playerid][20] = CreatePlayerTextDraw(playerid, 470.0, 170.3 + spos, "_"); //Scroll box
  393.                 PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][20], 460.0, 5.0);
  394.                 PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][20], 0.0, ssize);
  395.                 PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][20], 1);
  396.                 PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][20], AD_SCROLL_BOX_COLOR);
  397.                 PlayerTextDrawShow(playerid, adArrayPTDs[playerid][20]);
  398.             }
  399.         }
  400.         else if(clickedid == adArrayTDs[10])
  401.         {
  402.             if(adPageID[playerid] < floatround(adMaxItems[playerid] / 8, floatround_tozero))
  403.             {
  404.                 new i, Float:ssize, Float:spos;
  405.                 adPageID[playerid]++;
  406.                 adItemID[playerid] = adPageID[playerid] * 8;
  407.                 for(i = 11; i > 4; --i)
  408.                 {
  409.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][i], AD_ITEMS_BOX_COLOR);
  410.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][i]);
  411.                 }
  412.                 PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][4], AD_SELECTED_ITEM_BOX_COLOR);
  413.                 PlayerTextDrawShow(playerid, adArrayPTDs[playerid][4]);
  414.                 i = adPageID[playerid] * 8;
  415.                 for(new j = i + 8, c; i < j; i++)
  416.                 {
  417.                     PlayerTextDrawSetString(playerid, adArrayPTDs[playerid][12 + c], adItems[playerid][i]);
  418.                     if(!adItems[playerid][i]{0}) PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][12 + c], 0);
  419.                     else PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][12 + c], 1);
  420.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][12 + c]);
  421.                     c++;
  422.                 }
  423.                 PlayerTextDrawDestroy(playerid, adArrayPTDs[playerid][20]);
  424.                 ssize = 9.8 / (floatround(adMaxItems[playerid] / 8, floatround_tozero) + 1);
  425.                 spos = (ssize * 9) * adPageID[playerid];
  426.                 adArrayPTDs[playerid][20] = CreatePlayerTextDraw(playerid, 470.0, 170.3 + spos, "_"); //Scroll box
  427.                 PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][20], 460.0, 5.0);
  428.                 PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][20], 0.0, ssize);
  429.                 PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][20], 1);
  430.                 PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][20], AD_SCROLL_BOX_COLOR);
  431.                 PlayerTextDrawShow(playerid, adArrayPTDs[playerid][20]);
  432.             }
  433.         }
  434.     }
  435.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  436.         && defined ad_OnPlayerClickTextDraw
  437.         return ad_OnPlayerClickTextDraw(playerid, clickedid);
  438.     #else
  439.         return 0;
  440.     #endif
  441. }
  442.  
  443. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  444.     #if defined _ALS_OnPlayerClickTextDraw
  445.         #undef OnPlayerClickTextDraw
  446.     #else
  447.         #define _ALS_OnPlayerClickTextDraw
  448.     #endif
  449.     #define OnPlayerClickTextDraw ad_OnPlayerClickTextDraw
  450.     #if defined ad_OnPlayerClickTextDraw
  451.         forward ad_OnPlayerClickTextDraw(playerid, Text:clickedid);
  452.     #endif
  453. #endif
  454.  
  455. #if defined _inc_y_hooks || defined _INC_y_hooks
  456.     hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
  457. #else
  458.     public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  459. #endif
  460. {
  461.     if(adDialogID[playerid] != AD_INVALID_ID)
  462.     {
  463.         if(playertextid == adArrayPTDs[playerid][1] || playertextid == adArrayPTDs[playerid][2])
  464.         {
  465.             new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  466.             ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  467.             CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  468.         }
  469.         else if(playertextid == adArrayPTDs[playerid][3])
  470.         {
  471.             new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  472.             ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  473.             CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 0, tmp_itemid);
  474.         }
  475.         else
  476.         {
  477.             #if defined FAST_DOUBLE_CLICK
  478.                 new gtc = GetTickCount();
  479.             #endif
  480.             if(playertextid == adArrayPTDs[playerid][12])
  481.             {
  482.                 if(adItemID[playerid] == 0 + (adPageID[playerid] * 8))
  483.                 {
  484.                     #if defined FAST_DOUBLE_CLICK
  485.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  486.                         {
  487.                             adLastClicked[playerid] = 0;
  488.                     #endif
  489.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  490.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  491.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  492.                     #if defined FAST_DOUBLE_CLICK
  493.                         }
  494.                         else adLastClicked[playerid] = gtc;
  495.                     #endif
  496.                 }
  497.                 else
  498.                 {
  499.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][4], AD_SELECTED_ITEM_BOX_COLOR);
  500.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][4]);
  501.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  502.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  503.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  504.                     adItemID[playerid] = 0 + (adPageID[playerid] * 8);
  505.                     #if defined FAST_DOUBLE_CLICK
  506.                         adLastClicked[playerid] = gtc;
  507.                     #endif
  508.                 }
  509.             }
  510.             else if(playertextid == adArrayPTDs[playerid][13])
  511.             {
  512.                 if(adItemID[playerid] == 1 + (adPageID[playerid] * 8))
  513.                 {
  514.                     #if defined FAST_DOUBLE_CLICK
  515.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  516.                         {
  517.                             adLastClicked[playerid] = 0;
  518.                     #endif
  519.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  520.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  521.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  522.                     #if defined FAST_DOUBLE_CLICK
  523.                         }
  524.                         else adLastClicked[playerid] = gtc;
  525.                     #endif
  526.                 }
  527.                 else
  528.                 {
  529.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][5], AD_SELECTED_ITEM_BOX_COLOR);
  530.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][5]);
  531.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  532.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  533.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  534.                     adItemID[playerid] = 1 + (adPageID[playerid] * 8);
  535.                     #if defined FAST_DOUBLE_CLICK
  536.                         adLastClicked[playerid] = gtc;
  537.                     #endif
  538.                 }
  539.             }
  540.             else if(playertextid == adArrayPTDs[playerid][14])
  541.             {
  542.                 if(adItemID[playerid] == 2 + (adPageID[playerid] * 8))
  543.                 {
  544.                     #if defined FAST_DOUBLE_CLICK
  545.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  546.                         {
  547.                             adLastClicked[playerid] = 0;
  548.                     #endif
  549.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  550.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  551.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  552.                     #if defined FAST_DOUBLE_CLICK
  553.                         }
  554.                         else adLastClicked[playerid] = gtc;
  555.                     #endif
  556.                 }
  557.                 else
  558.                 {
  559.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][6], AD_SELECTED_ITEM_BOX_COLOR);
  560.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][6]);
  561.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  562.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  563.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  564.                     adItemID[playerid] = 2 + (adPageID[playerid] * 8);
  565.                     #if defined FAST_DOUBLE_CLICK
  566.                         adLastClicked[playerid] = gtc;
  567.                     #endif
  568.                 }
  569.             }
  570.             else if(playertextid == adArrayPTDs[playerid][15])
  571.             {
  572.                 if(adItemID[playerid] == 3 + (adPageID[playerid] * 8))
  573.                 {
  574.                     #if defined FAST_DOUBLE_CLICK
  575.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  576.                         {
  577.                             adLastClicked[playerid] = 0;
  578.                     #endif
  579.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  580.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  581.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  582.                     #if defined FAST_DOUBLE_CLICK
  583.                         }
  584.                         else adLastClicked[playerid] = gtc;
  585.                     #endif
  586.                 }
  587.                 else
  588.                 {
  589.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][7], AD_SELECTED_ITEM_BOX_COLOR);
  590.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][7]);
  591.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  592.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  593.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  594.                     adItemID[playerid] = 3 + (adPageID[playerid] * 8);
  595.                     #if defined FAST_DOUBLE_CLICK
  596.                         adLastClicked[playerid] = gtc;
  597.                     #endif
  598.                 }
  599.             }
  600.             else if(playertextid == adArrayPTDs[playerid][16])
  601.             {
  602.                 if(adItemID[playerid] == 4 + (adPageID[playerid] * 8))
  603.                 {
  604.                     #if defined FAST_DOUBLE_CLICK
  605.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  606.                         {
  607.                             adLastClicked[playerid] = 0;
  608.                     #endif
  609.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  610.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  611.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  612.                     #if defined FAST_DOUBLE_CLICK
  613.                         }
  614.                         else adLastClicked[playerid] = gtc;
  615.                     #endif
  616.                 }
  617.                 else
  618.                 {
  619.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][8], AD_SELECTED_ITEM_BOX_COLOR);
  620.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][8]);
  621.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  622.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  623.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  624.                     adItemID[playerid] = 4 + (adPageID[playerid] * 8);
  625.                     #if defined FAST_DOUBLE_CLICK
  626.                         adLastClicked[playerid] = gtc;
  627.                     #endif
  628.                 }
  629.             }
  630.             else if(playertextid == adArrayPTDs[playerid][17])
  631.             {
  632.                 if(adItemID[playerid] == 5 + (adPageID[playerid] * 8))
  633.                 {
  634.                     #if defined FAST_DOUBLE_CLICK
  635.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  636.                         {
  637.                             adLastClicked[playerid] = 0;
  638.                     #endif
  639.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  640.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  641.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  642.                     #if defined FAST_DOUBLE_CLICK
  643.                         }
  644.                         else adLastClicked[playerid] = gtc;
  645.                     #endif
  646.                 }
  647.                 else
  648.                 {
  649.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][9], AD_SELECTED_ITEM_BOX_COLOR);
  650.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][9]);
  651.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  652.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  653.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  654.                     adItemID[playerid] = 5 + (adPageID[playerid] * 8);
  655.                     #if defined FAST_DOUBLE_CLICK
  656.                         adLastClicked[playerid] = gtc;
  657.                     #endif
  658.                 }
  659.             }
  660.             else if(playertextid == adArrayPTDs[playerid][18])
  661.             {
  662.                 if(adItemID[playerid] == 6 + (adPageID[playerid] * 8))
  663.                 {
  664.                     #if defined FAST_DOUBLE_CLICK
  665.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  666.                         {
  667.                             adLastClicked[playerid] = 0;
  668.                     #endif
  669.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  670.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  671.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  672.                     #if defined FAST_DOUBLE_CLICK
  673.                         }
  674.                         else adLastClicked[playerid] = gtc;
  675.                     #endif
  676.                 }
  677.                 else
  678.                 {
  679.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][10], AD_SELECTED_ITEM_BOX_COLOR);
  680.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][10]);
  681.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  682.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  683.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  684.                     adItemID[playerid] = 6 + (adPageID[playerid] * 8);
  685.                     #if defined FAST_DOUBLE_CLICK
  686.                         adLastClicked[playerid] = gtc;
  687.                     #endif
  688.                 }
  689.             }
  690.             else if(playertextid == adArrayPTDs[playerid][19])
  691.             {
  692.                 if(adItemID[playerid] == 7 + (adPageID[playerid] * 8))
  693.                 {
  694.                     #if defined FAST_DOUBLE_CLICK
  695.                         if(gtc - adLastClicked[playerid] <= MAX_CLICK_INTERVAL)
  696.                         {
  697.                             adLastClicked[playerid] = 0;
  698.                     #endif
  699.                     new tmp_dialogid = adDialogID[playerid], tmp_itemid = adItemID[playerid];
  700.                     ShowPlayerAltDialog(playerid, AD_INVALID_ID, -1, "", "", "");
  701.                     CallRemoteFunction("OnAltDialogResponse", "iiii", playerid, tmp_dialogid, 1, tmp_itemid);
  702.                     #if defined FAST_DOUBLE_CLICK
  703.                         }
  704.                         else adLastClicked[playerid] = gtc;
  705.                     #endif
  706.                 }
  707.                 else
  708.                 {
  709.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][11], AD_SELECTED_ITEM_BOX_COLOR);
  710.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][11]);
  711.                     if(adItemID[playerid] > 7) adItemID[playerid] %= 8;
  712.                     PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4], AD_ITEMS_BOX_COLOR);
  713.                     PlayerTextDrawShow(playerid, adArrayPTDs[playerid][adItemID[playerid] + 4]);
  714.                     adItemID[playerid] = 7 + (adPageID[playerid] * 8);
  715.                     #if defined FAST_DOUBLE_CLICK
  716.                         adLastClicked[playerid] = gtc;
  717.                     #endif
  718.                 }
  719.             }
  720.         }
  721.     }
  722.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  723.         && defined ad_OnPlayerClickPlayerTextDraw
  724.         return ad_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  725.     #else
  726.         return 0;
  727.     #endif
  728. }
  729.  
  730. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  731.     #if defined _ALS_OnPlayerClickPlayerTextDra\
  732.         || defined _ALS_OnPlayerClickPlayerTD
  733.         #undef OnPlayerClickPlayerTextDraw
  734.     #else
  735.         #define _ALS_OnPlayerClickPlayerTD
  736.     #endif
  737.     #define OnPlayerClickPlayerTextDraw ad_OnPlayerClickPlayerTextDraw
  738.     #if defined ad_OnPlayerClickPlayerTextDraw
  739.         forward ad_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  740.     #endif
  741. #endif
  742.  
  743. #if defined FAST_DOUBLE_CLICK
  744.     #undef FAST_DOUBLE_CLICK
  745.     #undef MAX_CLICK_INTERVAL
  746. #endif
  747.  
  748. ShowPlayerAltDialog(playerid, dialogid, style, caption[], info[], button1[], button2[] = "")
  749. {
  750.     if(IsPlayerConnected(playerid))
  751.     {
  752.         new i;
  753.         adDialogID[playerid] = AD_INVALID_ID;
  754.         for(i = (AD_MAX_DIALOG_PAGES * 8) - 1; i > -1; --i) adItems[playerid][i]{0} = EOS;
  755.         #undef AD_MAX_DIALOG_PAGES
  756.         for(i = sizeof(adArrayTDs) - 1; i > -1; --i) TextDrawHideForPlayer(playerid, adArrayTDs[i]);
  757.         for(i = sizeof(adArrayPTDs[]) - 1; i > -1; --i)
  758.         {
  759.             PlayerTextDrawDestroy(playerid, adArrayPTDs[playerid][i]);
  760.             adArrayPTDs[playerid][i] = PlayerText:65535;
  761.         }
  762.         if(dialogid <= AD_INVALID_ID)
  763.         {
  764.             adIgnoreEsc[playerid] = true;
  765.             return CancelSelectTextDraw(playerid);
  766.         }
  767.         if(style == AD_STYLE_LIST)
  768.         {
  769.             adPageID[playerid] = 0;
  770.             adItemID[playerid] = 0;
  771.             adDialogID[playerid] = dialogid;
  772.  
  773.             adArrayPTDs[playerid][4] = CreatePlayerTextDraw(playerid, 464.0, 155.0, "_"); //Item 1 box
  774.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][4], 181.0, 12.0);
  775.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][4], 0.0, 1.3);
  776.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][4], 1);
  777.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][4], AD_SELECTED_ITEM_BOX_COLOR);
  778.             #undef AD_SELECTED_ITEM_BOX_COLOR
  779.  
  780.             adArrayPTDs[playerid][5] = CreatePlayerTextDraw(playerid, 464.0, 170.5, "_"); //Item 2 box
  781.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][5], 181.0, 12.0);
  782.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][5], 0.0, 1.3);
  783.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][5], 1);
  784.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][5], AD_ITEMS_BOX_COLOR);
  785.  
  786.             adArrayPTDs[playerid][6] = CreatePlayerTextDraw(playerid, 464.0, 185.8, "_"); //Item 3 box
  787.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][6], 181.0, 12.0);
  788.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][6], 0.0, 1.3);
  789.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][6], 1);
  790.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][6], AD_ITEMS_BOX_COLOR);
  791.  
  792.             adArrayPTDs[playerid][7] = CreatePlayerTextDraw(playerid, 464.0, 201.0, "_"); //Item 4 box
  793.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][7], 181.0, 12.0);
  794.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][7], 0.0, 1.3);
  795.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][7], 1);
  796.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][7], AD_ITEMS_BOX_COLOR);
  797.  
  798.             adArrayPTDs[playerid][8] = CreatePlayerTextDraw(playerid, 464.0, 216.2, "_"); //Item 5 box
  799.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][8], 181.0, 12.0);
  800.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][8], 0.0, 1.3);
  801.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][8], 1);
  802.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][8], AD_ITEMS_BOX_COLOR);
  803.  
  804.             adArrayPTDs[playerid][9] = CreatePlayerTextDraw(playerid, 464.0, 231.2, "_"); //Item 6 box
  805.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][9], 181.0, 12.0);
  806.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][9], 0.0, 1.3);
  807.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][9], 1);
  808.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][9], AD_ITEMS_BOX_COLOR);
  809.  
  810.             adArrayPTDs[playerid][10] = CreatePlayerTextDraw(playerid, 464.0, 246.5, "_"); //Item 7 box
  811.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][10], 181.0, 12.0);
  812.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][10], 0.0, 1.3);
  813.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][10], 1);
  814.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][10], AD_ITEMS_BOX_COLOR);
  815.  
  816.             adArrayPTDs[playerid][11] = CreatePlayerTextDraw(playerid, 464.0, 261.8, "_"); //Item 8 box
  817.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][11], 181.0, 12.0);
  818.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][11], 0.0, 1.3);
  819.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][11], 1);
  820.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][11], AD_ITEMS_BOX_COLOR);
  821.             #undef AD_ITEMS_BOX_COLOR
  822.  
  823.             adArrayPTDs[playerid][12] = CreatePlayerTextDraw(playerid, 191.0, 156.3, ""); //Item 1
  824.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][12], 2);
  825.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][12], 460.0, 13.6);
  826.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][12], 0.27, 0.9);
  827.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][12], AD_ITEMS_COLOR);
  828.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][12], 0);
  829.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][12], 1);
  830.  
  831.             adArrayPTDs[playerid][13] = CreatePlayerTextDraw(playerid, 191.0, 171.8, ""); //Item 2
  832.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][13], 2);
  833.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][13], 460.0, 13.6);
  834.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][13], 0.27, 0.9);
  835.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][13], AD_ITEMS_COLOR);
  836.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][13], 0);
  837.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][13], 1);
  838.  
  839.             adArrayPTDs[playerid][14] = CreatePlayerTextDraw(playerid, 191.0, 187.3, ""); //Item 3
  840.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][14], 2);
  841.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][14], 460.0, 13.6);
  842.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][14], 0.27, 0.9);
  843.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][14], AD_ITEMS_COLOR);
  844.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][14], 0);
  845.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][14], 1);
  846.  
  847.             adArrayPTDs[playerid][15] = CreatePlayerTextDraw(playerid, 191.0, 202.6, ""); //Item 4
  848.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][15], 2);
  849.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][15], 460.0, 13.6);
  850.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][15], 0.27, 0.9);
  851.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][15], AD_ITEMS_COLOR);
  852.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][15], 0);
  853.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][15], 1);
  854.  
  855.             adArrayPTDs[playerid][16] = CreatePlayerTextDraw(playerid, 191.0, 217.6, ""); //Item 5
  856.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][16], 2);
  857.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][16], 460.0, 13.6);
  858.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][16], 0.27, 0.9);
  859.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][16], AD_ITEMS_COLOR);
  860.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][16], 0);
  861.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][16], 1);
  862.  
  863.             adArrayPTDs[playerid][17] = CreatePlayerTextDraw(playerid, 191.0, 232.7, ""); //Item 6
  864.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][17], 2);
  865.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][17], 460.0, 13.6);
  866.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][17], 0.27, 0.9);
  867.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][17], AD_ITEMS_COLOR);
  868.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][17], 0);
  869.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][17], 1);
  870.  
  871.             adArrayPTDs[playerid][18] = CreatePlayerTextDraw(playerid, 191.0, 247.9, ""); //Item 7
  872.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][18], 2);
  873.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][18], 460.0, 13.6);
  874.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][18], 0.27, 0.9);
  875.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][18], AD_ITEMS_COLOR);
  876.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][18], 0);
  877.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][18], 1);
  878.  
  879.             adArrayPTDs[playerid][19] = CreatePlayerTextDraw(playerid, 191.0, 263.0, ""); //Item 8
  880.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][19], 2);
  881.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][19], 460.0, 13.6);
  882.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][19], 0.27, 0.9);
  883.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][19], AD_ITEMS_COLOR);
  884.             #undef AD_ITEMS_COLOR
  885.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][19], 0);
  886.             PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][19], 1);
  887.  
  888.             if(strlen(caption) >= AD_MAX_CAPTION_LENGTH)
  889.             {
  890.                 caption[AD_MAX_CAPTION_LENGTH - 3] = '.';
  891.                 caption[AD_MAX_CAPTION_LENGTH - 2] = '.';
  892.                 caption[AD_MAX_CAPTION_LENGTH - 1] = '.';
  893.                 caption[AD_MAX_CAPTION_LENGTH] = EOS;
  894.                 #undef AD_MAX_CAPTION_LENGTH
  895.             }
  896.  
  897.             adArrayPTDs[playerid][0] = CreatePlayerTextDraw(playerid, 188.0, 141.0, caption); //Title
  898.             PlayerTextDrawFont(playerid, adArrayPTDs[playerid][0], 2);
  899.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][0], 0.27, 0.9);
  900.             PlayerTextDrawColor(playerid, adArrayPTDs[playerid][0], AD_TITLE_COLOR);
  901.             #undef AD_TITLE_COLOR
  902.             PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][0], 0);
  903.  
  904.             if(strlen(button1) >= AD_MAX_BUTTONS_LENGTH) button1[AD_MAX_BUTTONS_LENGTH] = EOS;
  905.             new lb2 = strlen(button2);
  906.             if(lb2 > 0)
  907.             {
  908.                 adArrayPTDs[playerid][1] = CreatePlayerTextDraw(playerid, 289.0, 292.0, button1); //Button 1
  909.                 PlayerTextDrawAlignment(playerid, adArrayPTDs[playerid][1], 2);
  910.                 PlayerTextDrawFont(playerid, adArrayPTDs[playerid][1], 2);
  911.                 PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][1], 12.0, 38.0);
  912.                 PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][1], 0.27, 0.9);
  913.                 PlayerTextDrawColor(playerid, adArrayPTDs[playerid][1], AD_BUTTONS_COLOR);
  914.                 PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][1], 0);
  915.                 PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][1], 1);
  916.  
  917.                 if(lb2 >= AD_MAX_BUTTONS_LENGTH) button2[AD_MAX_BUTTONS_LENGTH] = EOS;
  918.                 #undef AD_MAX_BUTTONS_LENGTH
  919.  
  920.                 adArrayPTDs[playerid][3] = CreatePlayerTextDraw(playerid, 350.5, 292.0, button2); //Button 2
  921.                 PlayerTextDrawAlignment(playerid, adArrayPTDs[playerid][3], 2);
  922.                 PlayerTextDrawFont(playerid, adArrayPTDs[playerid][3], 2);
  923.                 PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][3], 12.0, 38.0);
  924.                 PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][3], 0.27, 0.9);
  925.                 PlayerTextDrawColor(playerid, adArrayPTDs[playerid][3], AD_BUTTONS_COLOR);
  926.                 PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][3], 0);
  927.                 PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][3], 1);
  928.             }
  929.             else
  930.             {
  931.                 adArrayPTDs[playerid][2] = CreatePlayerTextDraw(playerid, 321.0, 292.0, button1); //Button 1 only
  932.                 PlayerTextDrawAlignment(playerid, adArrayPTDs[playerid][2], 2);
  933.                 PlayerTextDrawFont(playerid, adArrayPTDs[playerid][2], 2);
  934.                 PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][2], 12.0, 38.0);
  935.                 PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][2], 0.27, 0.9);
  936.                 PlayerTextDrawColor(playerid, adArrayPTDs[playerid][2], AD_BUTTONS_COLOR);
  937.                 #undef AD_BUTTONS_COLOR
  938.                 PlayerTextDrawSetShadow(playerid, adArrayPTDs[playerid][2], 0);
  939.                 PlayerTextDrawSetSelectable(playerid, adArrayPTDs[playerid][2], 1);
  940.             }
  941.             new strtmp[AD_MAX_ITEM_LENGTH], c = -1; i = 0;
  942.             #undef AD_MAX_ITEM_LENGTH
  943.             for(new j, s = strlen(info); i <= s; i++)
  944.             {
  945.                 if(info[i] == '\n' || i == s)
  946.                 {
  947.                     if(c + 1 >= sizeof adItems[]) break;
  948.                     c++;
  949.                     strmid(strtmp, info, j, i);
  950.                     strpack(adItems[playerid][c], strtmp);
  951.                     if(i - j >= sizeof adItems[][] * (cellbits / charbits))
  952.                     {
  953.                         adItems[playerid][c]{(sizeof(adItems[][]) * (cellbits / charbits)) - 3} = '.';
  954.                         adItems[playerid][c]{(sizeof(adItems[][]) * (cellbits / charbits)) - 2} = '.';
  955.                         adItems[playerid][c]{(sizeof(adItems[][]) * (cellbits / charbits)) - 1} = '.';
  956.                     }
  957.                     if(c < 8) PlayerTextDrawSetString(playerid, adArrayPTDs[playerid][12 + c], adItems[playerid][c]);
  958.                     j = i + 1;
  959.                 }
  960.             }
  961.             adMaxItems[playerid] = c;
  962.  
  963.             adArrayPTDs[playerid][20] = CreatePlayerTextDraw(playerid, 470.0, 170.3, "_"); //Scroll box
  964.             PlayerTextDrawTextSize(playerid, adArrayPTDs[playerid][20], 460.0, 5.0);
  965.             PlayerTextDrawLetterSize(playerid, adArrayPTDs[playerid][20], 0.0, 9.8 / (floatround(c / 8, floatround_tozero) + 1));
  966.             PlayerTextDrawUseBox(playerid, adArrayPTDs[playerid][20], 1);
  967.             PlayerTextDrawBoxColor(playerid, adArrayPTDs[playerid][20], AD_SCROLL_BOX_COLOR);
  968.             #undef AD_SCROLL_BOX_COLOR
  969.  
  970.             for(i = sizeof(adArrayTDs) - 1; i > -1; --i)
  971.             {
  972.                 if(c < 8 && (6 <= i <= 7 || 9 <= i <= 10)
  973.                 || lb2 > 0 && i == 5 || lb2 < 1 && 3 <= i <= 4) continue;
  974.                 TextDrawShowForPlayer(playerid, adArrayTDs[i]);
  975.             }
  976.             for(i = sizeof(adArrayPTDs[]) - 1; i > -1; --i)
  977.             {
  978.                 if(c < 8 && i == 20) continue;
  979.                 PlayerTextDrawShow(playerid, adArrayPTDs[playerid][i]);
  980.             }
  981.             return SelectTextDraw(playerid, AD_SELECTION_COLOR);
  982.             #undef AD_SELECTION_COLOR
  983.         }
  984.     }
  985.     return 0;
  986. }
  987.  
  988. stock GetPlayerAltDialog(playerid)
  989. {
  990.     if(!IsPlayerConnected(playerid)) return AD_INVALID_ID;
  991.     return adDialogID[playerid];
  992. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top