1
0

intlist.pwn 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. House List Module
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #include <YSI\y_hooks>
  34. #define INTERIOR_TYPE_SMALL (0)
  35. #define INTERIOR_TYPE_MEDIUM (1)
  36. #define INTERIOR_TYPE_LARGE (2)
  37. new Float:InteriorsList[42][4] = {
  38. {140.17, 1366.07, 1083.65, 5.0},
  39. {2324.53, -1149.54, 1050.71, 12.0},
  40. {225.68, 1021.45, 1084.02, 7.0},
  41. {234.19, 1063.73, 1084.21, 6.0},
  42. {226.30, 1114.24, 1080.99, 5.0},
  43. {235.34, 1186.68, 1080.26, 3.0},
  44. {491.07, 1398.50, 1080.26, 2.0},
  45. {24.04, 1340.17, 1084.38, 10.0},
  46. {-283.44, 1470.93, 1084.38, 15.0},
  47. {-260.49, 1456.75, 1084.37, 4.0},
  48. {83.03, 1322.28, 1083.87, 9.0},
  49. {2317.89, -1026.76, 1050.22, 9.0},
  50. {2495.98, -1692.08, 1014.74, 3.0},
  51. {2807.48, -1174.76, 1025.57, 8.0},
  52. {2196.85, -1204.25, 1049.02, 6.0},
  53. {377.15, 1417.41, 1081.33, 15.0},
  54. {2270.38, -1210.35, 1047.56, 10.0},
  55. {446.99, 1397.07, 1084.30, 2.0},
  56. {387.22, 1471.70, 1080.19, 15.0},
  57. {22.88, 1403.33, 1084.44, 5.0},
  58. {2365.31, -1135.60, 1050.88, 8.0},
  59. {2237.59, -1081.64, 1049.02, 2.0},
  60. {295.04, 1472.26, 1080.26, 15.0},
  61. {261.12, 1284.30, 1080.26, 4.0},
  62. {221.92, 1140.20, 1082.61, 4.0},
  63. {-68.81, 1351.21, 1080.21, 6.0},
  64. {260.85, 1237.24, 1084.26, 9.0},
  65. {2468.84, -1698.24, 1013.51, 2.0},
  66. {223.20, 1287.08, 1082.14, 1.0},
  67. {2283.04, -1140.28, 1050.90, 11.0},
  68. {328.05, 1477.73, 1084.44, 15.0},
  69. {223.20, 1287.08, 1082.14, 1.0},
  70. {-42.59, 1405.47, 1084.43, 8.0},
  71. {446.90, 506.35, 1001.42, 12.0},
  72. {299.78, 309.89, 1003.30, 4.0},
  73. {2308.77, -1212.94, 1049.02, 6.0},
  74. {2233.64, -1115.26, 1050.88, 5.0},
  75. {2218.40, -1076.18, 1050.48, 1.0},
  76. {266.50, 304.90, 999.15, 2.0},
  77. {243.72, 304.91, 999.15, 1.0},
  78. {343.81, 304.86, 999.15, 6.0},
  79. {2259.38, -1135.77, 1050.64, 10.0}
  80. };
  81. ListInteriors(playerid, iType)
  82. {
  83. szMiscArray[0] = 0; // this must be done to null initiate the global variable.
  84. switch(iType)
  85. {
  86. case INTERIOR_TYPE_SMALL:
  87. {
  88. format(szMiscArray, sizeof(szMiscArray),
  89. "Interior (30)\n\
  90. Interior (31)\n\
  91. Interior (32)\n\
  92. Interior (33)\n\
  93. Interior (34)\n\
  94. Interior (35)\n\
  95. Interior (36)\n\
  96. Interior (37)\n\
  97. Interior (38)\n\
  98. Interior (39)\n\
  99. Interior (40)\n\
  100. Interior (41)\n\
  101. Interior (42)\n\
  102. Interior (43)"
  103. );
  104. }
  105. case INTERIOR_TYPE_MEDIUM:
  106. {
  107. format(szMiscArray, sizeof(szMiscArray),
  108. "Interior (7)\n\
  109. Interior (8)\n\
  110. Interior (9)\n\
  111. Interior (10\n\
  112. Interior (11)\n\
  113. Interior (12)\n\
  114. Interior (13)\n\
  115. Interior (14)\n\
  116. Interior (15)\n\
  117. Iterior (16)\n\
  118. Interior (17)\n\
  119. Interior (18)\n\
  120. Interior (19)\n\
  121. Interior (20)\n\
  122. Interior (21)\n\
  123. Interior (22)\n\
  124. Interior (23)\n\
  125. Interior (24)\n\
  126. Interior (25)\n\
  127. Interior (26)\n\
  128. Interior (27)\n\
  129. Interior (28)\n\
  130. Interior (29)"
  131. );
  132. }
  133. case INTERIOR_TYPE_LARGE:
  134. {
  135. format(szMiscArray, sizeof(szMiscArray),
  136. "Interior (2)\n\
  137. Interior (3)\n\
  138. Interior (4)\n\
  139. Interior (5)\n\
  140. Interior (6)"
  141. );
  142. }
  143. }
  144. return ShowPlayerDialogEx(playerid, DIALOG_LIST_INTERIORS2, DIALOG_STYLE_LIST, "Interior List", szMiscArray, "Goto", "Cancel");
  145. }
  146. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  147. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  148. if(dialogid == DIALOG_LIST_INTERIORS && response)
  149. {
  150. ListInteriors(playerid, listitem);
  151. }
  152. if(dialogid == DIALOG_LIST_INTERIORS2 && response)
  153. {
  154. new stpos = strfind(inputtext, "(");
  155. new fpos = strfind(inputtext, ")");
  156. new idstr[4], id;
  157. strmid(idstr, inputtext, stpos+1, fpos);
  158. id = strval(idstr);
  159. SetPlayerInterior(playerid, floatround(InteriorsList[id][3]));
  160. SetPlayerPos(playerid, InteriorsList[id][0], InteriorsList[id][1], InteriorsList[id][2]);
  161. }
  162. return 0;
  163. }
  164. CMD:interiors(playerid, params[])
  165. {
  166. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use this command!");
  167. ShowPlayerDialogEx(playerid, DIALOG_LIST_INTERIORS, DIALOG_STYLE_LIST, "Select a category", "Small Interiors\nMedium Interiors\nLarge Interiors", "Select", "Cancel");
  168. return 1;
  169. }