func.pwn 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136
  1. DefaultCategoryManagerData(playerid) {
  2. g_CatManagerData[playerid][CATMANAGER_DATA_CATEGORY] = INVALID_CATEGORY_ID;
  3. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ID] = INVALID_MODEL_ID;
  4. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ROW] = INVALID_ROW;
  5. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_WINDOW] = CATMANAGER_WINDOW_ALL;
  6. g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_ALL] = MIN_CATMANAGER_PAGE;
  7. g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_CAT] = MIN_CATMANAGER_PAGE;
  8. g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_ALL] = MIN_CATMANAGER_PAGE;
  9. g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_CAT] = MIN_CATMANAGER_PAGE;
  10. strpack(g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_ALL], "", MAX_SEARCH_LEN+1);
  11. strpack(g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_CAT], "", MAX_SEARCH_LEN+1);
  12. for(new row; row < MAX_CATMANAGER_ROWS; row ++) {
  13. g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_ALL][row] = INVALID_MODEL_ID;
  14. g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_CAT][row] = INVALID_MODEL_ID;
  15. }
  16. }
  17. CreateGenericCategoryManager() {
  18. g_CatManagerGTD[CATMANAGER_GTD_BG] =
  19. TextDrawCreate (116.0, 47.0, "_");
  20. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_BG], 2);
  21. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_BG], 0.0, 44.4);
  22. TextDrawUseBox (g_CatManagerGTD[CATMANAGER_GTD_BG], 1);
  23. TextDrawBoxColor (g_CatManagerGTD[CATMANAGER_GTD_BG], 100);
  24. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_BG], 0.0, 230.0);
  25. // Caption
  26. g_CatManagerGTD[CATMANAGER_GTD_CAPTION] =
  27. TextDrawCreate (2.0, 35.0, "Category Manager");
  28. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 255);
  29. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 0);
  30. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 0.5, 2.0);
  31. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], RGBA_WHITE);
  32. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 1);
  33. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 1);
  34. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CAPTION], 0);
  35. g_CatManagerGTD[CATMANAGER_GTD_CLOSE] =
  36. TextDrawCreate (221.0, 47.0, "X");
  37. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 2);
  38. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 255);
  39. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 1);
  40. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 0.3, 1.0);
  41. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], RGBA_WHITE);
  42. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 1);
  43. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 1);
  44. TextDrawUseBox (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 1);
  45. TextDrawBoxColor (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 0xFF000064);
  46. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 10.0, 20.0);
  47. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CLOSE], 1);
  48. g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE] =
  49. TextDrawCreate (38.0, 60.0, "Create Category");
  50. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 2);
  51. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 255);
  52. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 1);
  53. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 0.2, 1.0);
  54. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], RGBA_WHITE);
  55. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 1);
  56. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 1);
  57. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 10.0, 74.0);
  58. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_CREATE], 1);
  59. g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY] =
  60. TextDrawCreate (116.0, 60.0, "Destroy Category");
  61. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 2);
  62. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 255);
  63. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 1);
  64. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 0.2, 1.0);
  65. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], RGBA_WHITE);
  66. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 1);
  67. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 1);
  68. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 10.0, 74.0);
  69. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_DESTROY], 1);
  70. g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME] =
  71. TextDrawCreate (194.0, 60.0, "Rename Category");
  72. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 2);
  73. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 255);
  74. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 1);
  75. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 0.2, 1.0);
  76. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], RGBA_WHITE);
  77. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 1);
  78. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 1);
  79. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 10.0, 74.0);
  80. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_RENAME], 1);
  81. g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL] =
  82. TextDrawCreate (11.0, 99.0, "<<");
  83. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 2);
  84. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 255);
  85. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 1);
  86. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 0.2, 1.0);
  87. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], RGBA_WHITE);
  88. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 1);
  89. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 1);
  90. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 10.0, 20.0);
  91. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_ALL], 1);
  92. g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT] =
  93. TextDrawCreate (11.0, 281.0, "<<");
  94. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 2);
  95. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 255);
  96. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 1);
  97. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 0.2, 1.0);
  98. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], RGBA_WHITE);
  99. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 1);
  100. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 1);
  101. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 10.0, 20.0);
  102. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_F_CAT], 1);
  103. g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL] =
  104. TextDrawCreate (34.0, 99.0, "<");
  105. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 2);
  106. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 255);
  107. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 1);
  108. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 0.2, 1.0);
  109. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], RGBA_WHITE);
  110. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 1);
  111. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 1);
  112. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 10.0, 20.0);
  113. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_ALL], 1);
  114. g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT] =
  115. TextDrawCreate (34.0, 281.0, "<");
  116. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 2);
  117. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 255);
  118. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 1);
  119. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 0.2, 1.0);
  120. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], RGBA_WHITE);
  121. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 1);
  122. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 1);
  123. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 10.0, 20.0);
  124. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_P_CAT], 1);
  125. g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL] =
  126. TextDrawCreate (198.0, 99.0, ">");
  127. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 2);
  128. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 255);
  129. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 1);
  130. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 0.2, 1.0);
  131. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], RGBA_WHITE);
  132. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 1);
  133. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 1);
  134. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 10.0, 20.0);
  135. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_ALL], 1);
  136. g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT] =
  137. TextDrawCreate (198.0, 281.0, ">");
  138. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 2);
  139. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 255);
  140. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 1);
  141. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 0.2, 1.0);
  142. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], RGBA_WHITE);
  143. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 1);
  144. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 1);
  145. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 10.0, 20.0);
  146. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_N_CAT], 1);
  147. g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL] =
  148. TextDrawCreate (221.0, 99.0, ">>");
  149. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 2);
  150. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 255);
  151. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 1);
  152. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 0.2, 1.0);
  153. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], RGBA_WHITE);
  154. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 1);
  155. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 1);
  156. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 10.0, 20.0);
  157. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_ALL], 1);
  158. g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT] =
  159. TextDrawCreate (221.0, 281.0, ">>");
  160. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 2);
  161. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 255);
  162. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 1);
  163. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 0.2, 1.0);
  164. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], RGBA_WHITE);
  165. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 1);
  166. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 1);
  167. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 10.0, 20.0);
  168. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_PAGE_L_CAT], 1);
  169. g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW] =
  170. TextDrawCreate (116.0, 268.0, "Category Models Below");
  171. TextDrawAlignment (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 2);
  172. TextDrawBackgroundColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 255);
  173. TextDrawFont (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 1);
  174. TextDrawLetterSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 0.2, 1.0);
  175. TextDrawColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], RGBA_WHITE);
  176. TextDrawSetOutline (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 1);
  177. TextDrawSetProportional (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 1);
  178. TextDrawUseBox (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 1);
  179. TextDrawBoxColor (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 0xFFFFFF64);
  180. TextDrawTextSize (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 0.0, 230.0);
  181. TextDrawSetSelectable (g_CatManagerGTD[CATMANAGER_GTD_CATEGORY_BELOW], 0);
  182. }
  183. DestroyGenericCategoryManager() {
  184. for(new gtd; gtd < CATMANAGER_GTDS; gtd ++) {
  185. TextDrawDestroy( g_CatManagerGTD[gtd] );
  186. g_CatManagerGTD[gtd] = Text: INVALID_TEXT_DRAW;
  187. }
  188. }
  189. CreatePlayerCategoryManager(playerid) {
  190. // Category Type: Models
  191. g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS] =
  192. CreatePlayerTextDraw (playerid, 29.0, 73.0, "Models");
  193. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 2);
  194. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 255);
  195. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 1);
  196. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 0.2, 1.0);
  197. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], RGBA_WHITE);
  198. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 1);
  199. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 1);
  200. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 1);
  201. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 0x0);
  202. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 10.0, 55.0);
  203. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 1);
  204. // Category Type: Vehicles
  205. g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES] =
  206. CreatePlayerTextDraw (playerid, 87.0, 73.0, "Vehicles");
  207. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 2);
  208. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 255);
  209. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 1);
  210. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 0.2, 1.0);
  211. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], RGBA_WHITE);
  212. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 1);
  213. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 1);
  214. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 1);
  215. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 0x0);
  216. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 10.0, 55.0);
  217. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 1);
  218. // Category Type: Skins
  219. g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS] =
  220. CreatePlayerTextDraw (playerid, 145.0, 73.0, "Skins");
  221. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 2);
  222. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 255);
  223. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 1);
  224. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 0.2, 1.0);
  225. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], RGBA_WHITE);
  226. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 1);
  227. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 1);
  228. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 1);
  229. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 0x0);
  230. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 10.0, 55.0);
  231. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 1);
  232. // Category Type: Textures
  233. g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES] =
  234. CreatePlayerTextDraw (playerid, 203.0, 73.0, "Textures");
  235. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 2);
  236. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 255);
  237. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 1);
  238. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 0.2, 1.0);
  239. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], RGBA_WHITE);
  240. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 1);
  241. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 1);
  242. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 1);
  243. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 0x0);
  244. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 10.0, 55.0);
  245. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 1);
  246. // Category ID / Name
  247. g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME] =
  248. CreatePlayerTextDraw (playerid, 116.0, 86.0, "Category");
  249. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 2);
  250. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 255);
  251. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 1);
  252. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 0.2, 1.0);
  253. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], RGBA_WHITE);
  254. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 1);
  255. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 1);
  256. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 10.0, 230.0);
  257. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], 1);
  258. // Page (All)
  259. g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL] =
  260. CreatePlayerTextDraw (playerid, 116.0, 99.0, "Page");
  261. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 2);
  262. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 255);
  263. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 1);
  264. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 0.2, 1.0);
  265. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], RGBA_WHITE);
  266. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 1);
  267. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 1);
  268. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 10.0, 138.0);
  269. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL], 1);
  270. // Page (Category)
  271. g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT] =
  272. CreatePlayerTextDraw (playerid, 116.0, 281.0, "Page");
  273. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 2);
  274. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 255);
  275. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 1);
  276. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 0.2, 1.0);
  277. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], RGBA_WHITE);
  278. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 1);
  279. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 1);
  280. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 10.0, 138.0);
  281. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], 1);
  282. // Search (All)
  283. g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL] =
  284. CreatePlayerTextDraw (playerid, 116.0, 112.0, "Search");
  285. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 2);
  286. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 255);
  287. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 1);
  288. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 0.2, 1.0);
  289. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], RGBA_WHITE);
  290. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 1);
  291. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 1);
  292. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 10.0, 230.0);
  293. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL], 1);
  294. // Search (Category)
  295. g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT] =
  296. CreatePlayerTextDraw (playerid, 116.0, 294.0, "Search");
  297. PlayerTextDrawAlignment (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 2);
  298. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 255);
  299. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 1);
  300. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 0.2, 1.0);
  301. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], RGBA_WHITE);
  302. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 1);
  303. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 1);
  304. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 10.0, 230.0);
  305. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], 1);
  306. if( g_PlayerData[playerid][PLAYER_DATA_TDMODE] == TDMODE_CATMANAGER_TEXTURES ) {
  307. // Column: Texture Model ID (All)
  308. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL] =
  309. CreatePlayerTextDraw (playerid, 1.0, 125.0, "Model ID");
  310. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 255);
  311. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  312. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 0.2, 1.0);
  313. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], RGBA_WHITE);
  314. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  315. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  316. // Column: Texture Model ID (Category)
  317. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT] =
  318. CreatePlayerTextDraw (playerid, 1.0, 307.0, "Model ID");
  319. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 255);
  320. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  321. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 0.2, 1.0);
  322. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], RGBA_WHITE);
  323. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  324. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  325. // Column: Texture TXD (All)
  326. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL] =
  327. CreatePlayerTextDraw (playerid, 43.0, 125.0, "Txd");
  328. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 255);
  329. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  330. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 0.2, 1.0);
  331. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], RGBA_WHITE);
  332. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  333. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  334. // Column: Texture TXD (Category)
  335. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT] =
  336. CreatePlayerTextDraw (playerid, 43.0, 307.0, "Txd");
  337. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 255);
  338. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  339. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 0.2, 1.0);
  340. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], RGBA_WHITE);
  341. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  342. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  343. // Column: Texture Name (All)
  344. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL] =
  345. CreatePlayerTextDraw (playerid, 114.0, 125.0, "Name");
  346. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], 255);
  347. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], 1);
  348. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], 0.2, 1.0);
  349. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], RGBA_WHITE);
  350. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], 1);
  351. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL], 1);
  352. // Column: Texture Name (Category)
  353. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT] =
  354. CreatePlayerTextDraw (playerid, 114.0, 307.0, "Name");
  355. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], 255);
  356. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], 1);
  357. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], 0.2, 1.0);
  358. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], RGBA_WHITE);
  359. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], 1);
  360. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT], 1);
  361. for(new row; row < MAX_CATMANAGER_ROWS; row ++) {
  362. // Row: Texture Model ID (All)
  363. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row] =
  364. CreatePlayerTextDraw (playerid, 1.0, 138.0 + (row * 13.0), "Model ID");
  365. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 255);
  366. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  367. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 0.2, 1.0);
  368. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], RGBA_WHITE);
  369. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  370. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  371. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  372. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 0x00000000);
  373. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 40.0, 10.0);
  374. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  375. // Row: Texture Model ID (Category)
  376. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row] =
  377. CreatePlayerTextDraw (playerid, 1.0, 320.0 + (row * 13.0), "Model ID");
  378. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 255);
  379. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  380. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 0.2, 1.0);
  381. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], RGBA_WHITE);
  382. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  383. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  384. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  385. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 0x00000000);
  386. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 40.0, 10.0);
  387. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  388. // Row: Texture TXD (All)
  389. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row] =
  390. CreatePlayerTextDraw (playerid, 43.0, 138.0 + (row * 13.0), "Txd");
  391. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 255);
  392. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  393. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 0.2, 1.0);
  394. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], RGBA_WHITE);
  395. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  396. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  397. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  398. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 0x00000000);
  399. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 111.0, 10.0);
  400. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  401. // Row: Texture TXD (Category)
  402. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row] =
  403. CreatePlayerTextDraw (playerid, 43.0, 320.0 + (row * 13.0), "Txd");
  404. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 255);
  405. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  406. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 0.2, 1.0);
  407. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], RGBA_WHITE);
  408. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  409. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  410. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  411. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 0x00000000);
  412. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 111.0, 10.0);
  413. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  414. // Row: Texture Name (All)
  415. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row] =
  416. CreatePlayerTextDraw (playerid, 114.0, 138.0 + (row * 13.0), "Name");
  417. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 255);
  418. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 1);
  419. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 0.2, 1.0);
  420. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], RGBA_WHITE);
  421. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 1);
  422. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 1);
  423. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 1);
  424. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 0x00000000);
  425. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 231.0, 10.0);
  426. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], 1);
  427. // Row: Texture Name (Category)
  428. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row] =
  429. CreatePlayerTextDraw (playerid, 114.0, 320.0 + (row * 13.0), "Name");
  430. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 255);
  431. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 1);
  432. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 0.2, 1.0);
  433. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], RGBA_WHITE);
  434. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 1);
  435. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 1);
  436. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 1);
  437. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 0x00000000);
  438. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 231.0, 10.0);
  439. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], 1);
  440. }
  441. } else {
  442. // Column: Model ID (All)
  443. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL] =
  444. CreatePlayerTextDraw (playerid, 1.0, 125.0, "ID");
  445. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 255);
  446. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  447. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 0.2, 1.0);
  448. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], RGBA_WHITE);
  449. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  450. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL], 1);
  451. // Column: Model ID (Category)
  452. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT] =
  453. CreatePlayerTextDraw (playerid, 1.0, 307.0, "ID");
  454. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 255);
  455. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  456. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 0.2, 1.0);
  457. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], RGBA_WHITE);
  458. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  459. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT], 1);
  460. // Column: Model Name (All)
  461. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL] =
  462. CreatePlayerTextDraw (playerid, 33.0, 125.0, "Name");
  463. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 255);
  464. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  465. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 0.2, 1.0);
  466. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], RGBA_WHITE);
  467. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  468. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL], 1);
  469. // Column: Model Name (Category)
  470. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT] =
  471. CreatePlayerTextDraw (playerid, 33.0, 307.0, "Name");
  472. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 255);
  473. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  474. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 0.2, 1.0);
  475. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], RGBA_WHITE);
  476. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  477. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT], 1);
  478. // Column: Unused (All)
  479. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL] = PlayerText: INVALID_TEXT_DRAW;
  480. // Column: Unused (Category)
  481. g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT] = PlayerText: INVALID_TEXT_DRAW;
  482. for(new row; row < MAX_CATMANAGER_ROWS; row ++) {
  483. // Row: Model ID (All)
  484. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row] =
  485. CreatePlayerTextDraw (playerid, 1.0, 138.0 + (row * 13.0), "ID");
  486. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 255);
  487. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  488. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 0.2, 1.0);
  489. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], RGBA_WHITE);
  490. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  491. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  492. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  493. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 0x00000000);
  494. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 30.0, 10.0);
  495. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], 1);
  496. // Row: Model ID (Category)
  497. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row] =
  498. CreatePlayerTextDraw (playerid, 1.0, 320.0 + (row * 13.0), "ID");
  499. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 255);
  500. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  501. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 0.2, 1.0);
  502. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], RGBA_WHITE);
  503. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  504. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  505. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  506. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 0x00000000);
  507. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 30.0, 10.0);
  508. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], 1);
  509. // Row: Model Name (All)
  510. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row] =
  511. CreatePlayerTextDraw (playerid, 33.0, 138.0 + (row * 13.0), "Name");
  512. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 255);
  513. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  514. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 0.2, 1.0);
  515. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], RGBA_WHITE);
  516. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  517. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  518. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  519. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 0x00000000);
  520. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 231.0, 10.0);
  521. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], 1);
  522. // Row: Model Name (Category)
  523. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row] =
  524. CreatePlayerTextDraw (playerid, 33.0, 320.0 + (row * 13.0), "Name");
  525. PlayerTextDrawBackgroundColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 255);
  526. PlayerTextDrawFont (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  527. PlayerTextDrawLetterSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 0.2, 1.0);
  528. PlayerTextDrawColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], RGBA_WHITE);
  529. PlayerTextDrawSetOutline (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  530. PlayerTextDrawSetProportional (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  531. PlayerTextDrawUseBox (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  532. PlayerTextDrawBoxColor (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 0x00000000);
  533. PlayerTextDrawTextSize (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 231.0, 10.0);
  534. PlayerTextDrawSetSelectable (playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], 1);
  535. // Row: Unused (All)
  536. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row] = PlayerText: INVALID_TEXT_DRAW;
  537. // Row: Unused (Category)
  538. g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row] = PlayerText: INVALID_TEXT_DRAW;
  539. }
  540. }
  541. }
  542. DestroyPlayerCategoryManager(playerid) {
  543. for(new ptd; ptd < CATMANAGER_PTDS; ptd ++) {
  544. PlayerTextDrawDestroy(playerid, g_CatManagerPTD[playerid][ptd]);
  545. g_CatManagerPTD[playerid][ptd] = PlayerText: INVALID_TEXT_DRAW;
  546. }
  547. }
  548. ShowCategoryManager(playerid) {
  549. CreatePlayerCategoryManager(playerid);
  550. for(new gtd; gtd < CATMANAGER_GTDS; gtd ++) {
  551. TextDrawShowForPlayer(playerid, g_CatManagerGTD[gtd]);
  552. }
  553. DefaultCategoryManagerData(playerid);
  554. LoadCategoryManagerRowData(playerid, CATMANAGER_WINDOW_ALL);
  555. LoadCategoryManagerRowData(playerid, CATMANAGER_WINDOW_CAT);
  556. ApplyCategoryManagerCatName(playerid);
  557. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME]);
  558. ApplyCategoryManagerCatType(playerid);
  559. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS]);
  560. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES]);
  561. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS]);
  562. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES]);
  563. ApplyCategoryManagerPage(playerid, CATMANAGER_WINDOW_ALL);
  564. ApplyCategoryManagerPage(playerid, CATMANAGER_WINDOW_CAT);
  565. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL]);
  566. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT]);
  567. ApplyCategoryManagerSearch(playerid, CATMANAGER_WINDOW_ALL);
  568. ApplyCategoryManagerSearch(playerid, CATMANAGER_WINDOW_CAT);
  569. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL]);
  570. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT]);
  571. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_ALL]);
  572. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_1_CAT]);
  573. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_ALL]);
  574. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_2_CAT]);
  575. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL] != PlayerText: INVALID_TEXT_DRAW ) {
  576. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_ALL]);
  577. }
  578. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT] != PlayerText: INVALID_TEXT_DRAW) {
  579. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_COL_3_CAT]);
  580. }
  581. ApplyCategoryManagerRowData(playerid, CATMANAGER_WINDOW_ALL);
  582. ApplyCategoryManagerRowData(playerid, CATMANAGER_WINDOW_CAT);
  583. }
  584. HideCategoryManager(playerid) {
  585. DestroyPlayerCategoryManager(playerid);
  586. for(new gtd; gtd < CATMANAGER_GTDS; gtd ++) {
  587. TextDrawHideForPlayer(playerid, g_CatManagerGTD[gtd]);
  588. }
  589. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  590. case TDMODE_CATMANAGER_TEXTURES: {
  591. DestroyTextureView(playerid);
  592. }
  593. case TDMODE_CATMANAGER_MODELS, TDMODE_CATMANAGER_VEHICLES, TDMODE_CATMANAGER_SKINS: {
  594. HideModelView(playerid);
  595. }
  596. }
  597. }
  598. ApplyCategoryManagerCatType(playerid) {
  599. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 0x00000000); // Invisible Box
  600. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 0x00000000); // Invisible Box
  601. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 0x00000000); // Invisible Box
  602. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 0x00000000); // Invisible Box
  603. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  604. case TDMODE_CATMANAGER_MODELS: {
  605. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_MODELS], 0xFFFFFF64); // White Box
  606. }
  607. case TDMODE_CATMANAGER_VEHICLES: {
  608. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_VEHICLES], 0xFFFFFF64); // White Box
  609. }
  610. case TDMODE_CATMANAGER_SKINS: {
  611. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_SKINS], 0xFFFFFF64); // White Box
  612. }
  613. case TDMODE_CATMANAGER_TEXTURES: {
  614. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_TYPE_TEXTURES], 0xFFFFFF64); // White Box
  615. }
  616. default: {
  617. return 0;
  618. }
  619. }
  620. return 1;
  621. }
  622. ApplyCategoryManagerCatName(playerid) {
  623. new categoryid = g_CatManagerData[playerid][CATMANAGER_DATA_CATEGORY];
  624. if( categoryid == INVALID_CATEGORY_ID ) {
  625. return PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], "Category"), 0;
  626. }
  627. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  628. case TDMODE_CATMANAGER_MODELS: {
  629. GetModelCategoryName(categoryid, g_CategoryNameString, sizeof g_CategoryNameString);
  630. }
  631. case TDMODE_CATMANAGER_VEHICLES: {
  632. GetVehicleCategoryName(categoryid, g_CategoryNameString, sizeof g_CategoryNameString);
  633. }
  634. case TDMODE_CATMANAGER_SKINS: {
  635. GetSkinCategoryName(categoryid, g_CategoryNameString, sizeof g_CategoryNameString);
  636. }
  637. case TDMODE_CATMANAGER_TEXTURES: {
  638. GetTextureCategoryName(categoryid, g_CategoryNameString, sizeof g_CategoryNameString);
  639. }
  640. default: {
  641. return 0;
  642. }
  643. }
  644. format(g_TextdrawString, sizeof g_TextdrawString, "Category: %s", g_CategoryNameString);
  645. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_CATEGORY_NAME], g_TextdrawString);
  646. return 1;
  647. }
  648. ApplyCategoryManagerPage(playerid, bool:window) {
  649. format(g_TextdrawString, sizeof g_TextdrawString, "Page: %i / %i", GetCategoryManagerPage(playerid, window) + 1, GetCategoryManagerMaxPage(playerid, window) + 1);
  650. PlayerTextDrawSetString(playerid, (window == CATMANAGER_WINDOW_ALL) ? g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_ALL] : g_CatManagerPTD[playerid][CATMANAGER_PTD_PAGE_CAT], g_TextdrawString);
  651. }
  652. ApplyCategoryManagerSearch(playerid, bool:window) {
  653. GetCategoryManagerSearch(playerid, window, g_SearchString, sizeof g_SearchString);
  654. if( isempty(g_SearchString) ) {
  655. PlayerTextDrawSetString(playerid, (window == CATMANAGER_WINDOW_ALL) ? g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL] : g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], "Search");
  656. } else {
  657. format(g_TextdrawString, sizeof g_TextdrawString, "Search: %s", g_SearchString);
  658. PlayerTextDrawSetString(playerid, (window == CATMANAGER_WINDOW_ALL) ? g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_ALL] : g_CatManagerPTD[playerid][CATMANAGER_PTD_SEARCH_CAT], g_TextdrawString);
  659. }
  660. }
  661. ApplyCategoryManagerRowColor(playerid, bool:window, row) {
  662. new
  663. bool: select_window = g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_WINDOW],
  664. select_row = g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ROW],
  665. rgba_boxcolor = ( select_window == window && row == select_row ) ? 0xFFFFFF64 : 0x00000000
  666. ;
  667. if( window == CATMANAGER_WINDOW_ALL ) {
  668. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], rgba_boxcolor);
  669. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row]);
  670. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], rgba_boxcolor);
  671. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row]);
  672. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row] != PlayerText: INVALID_TEXT_DRAW ) {
  673. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], rgba_boxcolor);
  674. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row]);
  675. }
  676. } else if( window == CATMANAGER_WINDOW_CAT) {
  677. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], rgba_boxcolor);
  678. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row]);
  679. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], rgba_boxcolor);
  680. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row]);
  681. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row] != PlayerText: INVALID_TEXT_DRAW ) {
  682. PlayerTextDrawBoxColor(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], rgba_boxcolor);
  683. PlayerTextDrawShow(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row]);
  684. }
  685. }
  686. }
  687. ApplyCategoryManagerRowData(playerid, bool:window) {
  688. new invalid_id;
  689. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  690. case TDMODE_CATMANAGER_MODELS, TDMODE_CATMANAGER_VEHICLES, TDMODE_CATMANAGER_SKINS: {
  691. invalid_id = INVALID_MODEL_ID;
  692. }
  693. default: {
  694. invalid_id = INVALID_TEXTURE_ID;
  695. }
  696. }
  697. for(new row, row_id; row < MAX_CATMANAGER_ROWS; row ++) {
  698. row_id = GetCategoryManagerRowID(playerid, window, row);
  699. if( row_id == invalid_id ) {
  700. if( window == CATMANAGER_WINDOW_ALL ) {
  701. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row]);
  702. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row]);
  703. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row] != PlayerText: INVALID_TEXT_DRAW ) {
  704. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row]);
  705. }
  706. } else {
  707. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row]);
  708. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row]);
  709. if( g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row] != PlayerText: INVALID_TEXT_DRAW ) {
  710. PlayerTextDrawHide(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row]);
  711. }
  712. }
  713. continue;
  714. }
  715. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  716. case TDMODE_CATMANAGER_MODELS: {
  717. format(g_IntegerString, sizeof g_IntegerString, "%i", row_id);
  718. GetModelName(row_id, g_ModelString, sizeof g_ModelString);
  719. if( window == CATMANAGER_WINDOW_ALL ) {
  720. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], g_IntegerString); // Model ID
  721. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], g_ModelString); // Model Name
  722. } else {
  723. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], g_IntegerString); // Model ID
  724. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], g_ModelString); // Model Name
  725. }
  726. }
  727. case TDMODE_CATMANAGER_VEHICLES: {
  728. format(g_IntegerString, sizeof g_IntegerString, "%i", row_id);
  729. GetVehicleModelName(row_id, g_VehModelString, sizeof g_VehModelString);
  730. if( window == CATMANAGER_WINDOW_ALL ) {
  731. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], g_IntegerString); // Vehicle Model ID
  732. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], g_VehModelString); // Vehicle Model Name
  733. } else {
  734. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], g_IntegerString); // Vehicle Model ID
  735. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], g_VehModelString); // Vehicle Model Name
  736. }
  737. }
  738. case TDMODE_CATMANAGER_SKINS: {
  739. format(g_IntegerString, sizeof g_IntegerString, "%i", row_id);
  740. GetSkinName(row_id, g_SkinString, sizeof g_SkinString);
  741. if( window == CATMANAGER_WINDOW_ALL ) {
  742. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], g_IntegerString); // Skin Model ID
  743. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], g_SkinString); // Skin Model Name
  744. } else {
  745. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], g_IntegerString); // Skin Model ID
  746. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], g_SkinString); // Skin Model Name
  747. }
  748. }
  749. case TDMODE_CATMANAGER_TEXTURES: {
  750. new texture_modelid;
  751. GetTextureData(row_id, texture_modelid, g_TextureTXDString, sizeof g_TextureTXDString, g_TextureNameString, sizeof g_TextureNameString);
  752. format(g_IntegerString, sizeof g_IntegerString, "%i", texture_modelid);
  753. if( window == CATMANAGER_WINDOW_ALL ) {
  754. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_ALL][row], g_IntegerString); // Model ID
  755. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_ALL][row], g_TextureTXDString); // Texture TXD
  756. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_ALL][row], g_TextureNameString); // Texture Name
  757. } else {
  758. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_1_CAT][row], g_IntegerString); // Model ID
  759. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_2_CAT][row], g_TextureTXDString); // Texture TXD
  760. PlayerTextDrawSetString(playerid, g_CatManagerPTD[playerid][CATMANAGER_PTD_ROW_3_CAT][row], g_TextureNameString); // Texture Name
  761. }
  762. }
  763. }
  764. ApplyCategoryManagerRowColor(playerid, window, row);
  765. }
  766. return 1;
  767. }
  768. LoadCategoryManagerRowData(playerid, bool:window) {
  769. new invalid_id;
  770. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  771. case TDMODE_CATMANAGER_MODELS, TDMODE_CATMANAGER_VEHICLES, TDMODE_CATMANAGER_SKINS: {
  772. invalid_id = INVALID_MODEL_ID;
  773. }
  774. case TDMODE_CATMANAGER_TEXTURES: {
  775. invalid_id = INVALID_TEXTURE_ID;
  776. }
  777. }
  778. new categoryid = INVALID_CATEGORY_ID;
  779. if( window == CATMANAGER_WINDOW_CAT ) {
  780. categoryid = g_CatManagerData[playerid][CATMANAGER_DATA_CATEGORY];
  781. if( categoryid == INVALID_CATEGORY_ID ) {
  782. for(new row; row < MAX_CATMANAGER_ROWS; row ++) {
  783. SetCategoryManagerRowID(playerid, window, row, invalid_id);
  784. }
  785. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ID] = invalid_id;
  786. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ROW] = INVALID_ROW;
  787. return 1; // Invalid category for category window; reset!
  788. }
  789. }
  790. new
  791. page = GetCategoryManagerPage(playerid, window),
  792. result[MAX_CATMANAGER_ROWS],
  793. rows_added,
  794. max_offset
  795. ;
  796. GetCategoryManagerSearch(playerid, window, g_SearchString, sizeof g_SearchString);
  797. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  798. case TDMODE_CATMANAGER_MODELS: {
  799. rows_added = FindModels(
  800. .result = result,
  801. .result_size = MAX_CATMANAGER_ROWS,
  802. .search = g_SearchString,
  803. .categoryid = categoryid,
  804. .offset = page * MAX_CATMANAGER_ROWS,
  805. .max_offset = max_offset
  806. );
  807. }
  808. case TDMODE_CATMANAGER_VEHICLES: {
  809. rows_added = FindVehicleModels(
  810. .result = result,
  811. .result_size = MAX_CATMANAGER_ROWS,
  812. .search = g_SearchString,
  813. .categoryid = categoryid,
  814. .offset = page * MAX_CATMANAGER_ROWS,
  815. .max_offset = max_offset
  816. );
  817. }
  818. case TDMODE_CATMANAGER_SKINS: {
  819. rows_added = FindSkins(
  820. .result = result,
  821. .result_size = MAX_CATMANAGER_ROWS,
  822. .search = g_SearchString,
  823. .categoryid = categoryid,
  824. .offset = page * MAX_CATMANAGER_ROWS,
  825. .max_offset = max_offset
  826. );
  827. }
  828. case TDMODE_CATMANAGER_TEXTURES: {
  829. rows_added = FindTextures(
  830. .result = result,
  831. .result_size = MAX_CATMANAGER_ROWS,
  832. .search = g_SearchString,
  833. .categoryid = categoryid,
  834. .offset = page * MAX_CATMANAGER_ROWS,
  835. .max_offset = max_offset
  836. );
  837. }
  838. default: {
  839. return 0;
  840. }
  841. }
  842. for(new row; row < rows_added; row ++) {
  843. SetCategoryManagerRowID(playerid, window, row, result[row]);
  844. }
  845. for(new row = rows_added; row < MAX_CATMANAGER_ROWS; row ++) {
  846. SetCategoryManagerRowID(playerid, window, row, invalid_id);
  847. }
  848. if( window == CATMANAGER_WINDOW_ALL ) {
  849. g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_ALL] = max_offset / MAX_CATMANAGER_ROWS;
  850. } else {
  851. g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_CAT] = max_offset / MAX_CATMANAGER_ROWS;
  852. }
  853. g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ROW] = GetCategoryManagerNewSelectRow(playerid);
  854. return 1;
  855. }
  856. GetCategoryManagerNewSelectRow(playerid) {
  857. new
  858. bool: select_window = g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_WINDOW],
  859. select_id = g_CatManagerData[playerid][CATMANAGER_DATA_SELECT_ID]
  860. ;
  861. switch( g_PlayerData[playerid][PLAYER_DATA_TDMODE] ) {
  862. case TDMODE_CATMANAGER_MODELS, TDMODE_CATMANAGER_VEHICLES, TDMODE_CATMANAGER_SKINS: {
  863. if( select_id == INVALID_MODEL_ID ) {
  864. return INVALID_ROW;
  865. }
  866. }
  867. case TDMODE_CATMANAGER_TEXTURES: {
  868. if( select_id == INVALID_TEXTURE_ID ) {
  869. return INVALID_ROW;
  870. }
  871. }
  872. }
  873. for(new row, row_id; row < MAX_CATMANAGER_ROWS; row ++) {
  874. row_id = (select_window == CATMANAGER_WINDOW_CAT) ? g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_CAT][row] : g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_ALL][row];
  875. if( select_id == row_id ) {
  876. return row;
  877. }
  878. }
  879. return INVALID_ROW;
  880. }
  881. GetCategoryManagerMaxPage(playerid, bool:window) {
  882. if( window == CATMANAGER_WINDOW_ALL ) {
  883. return g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_ALL];
  884. } else {
  885. return g_CatManagerData[playerid][CATMANAGER_DATA_MAXPAGE_CAT];
  886. }
  887. }
  888. ShowCategoryManagerDialog(playerid, dialogid) {
  889. switch( dialogid ) {
  890. case DIALOGID_CATMANAGER_CAT_CREATE: {
  891. g_DialogCaption = "Category Manager: Create Category";
  892. g_DialogInfo = "Enter the name for the new category.";
  893. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, g_DialogCaption, g_DialogInfo, "Create", "Cancel");
  894. }
  895. case DIALOGID_CATMANAGER_CAT_DESTROY: {
  896. new categoryid = g_CatManagerData[playerid][CATMANAGER_DATA_CATEGORY];
  897. if( categoryid == INVALID_CATEGORY_ID ) {
  898. return 1;
  899. }
  900. g_DialogCaption = "Category Manager: Destroy Category";
  901. format(g_DialogInfo, sizeof g_DialogInfo, "Type & enter '%s' to delete this category.", CATMANAGER_DELETE_CODE);
  902. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, g_DialogCaption, g_DialogInfo, "Destroy", "Cancel");
  903. }
  904. case DIALOGID_CATMANAGER_CAT_RENAME: {
  905. new categoryid = g_CatManagerData[playerid][CATMANAGER_DATA_CATEGORY];
  906. if( categoryid == INVALID_CATEGORY_ID ) {
  907. return 1;
  908. }
  909. g_DialogCaption = "Category Manager: Rename Category";
  910. g_DialogInfo = "Please enter a new name for the category.";
  911. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, g_DialogCaption, g_DialogInfo, "Rename", "Cancel");
  912. }
  913. case DIALOGID_CATMANAGER_PAGE_ALL, DIALOGID_CATMANAGER_PAGE_CAT: {
  914. new bool:window = (dialogid == DIALOGID_CATMANAGER_PAGE_ALL) ? CATMANAGER_WINDOW_ALL : CATMANAGER_WINDOW_CAT;
  915. format(g_DialogInfo, sizeof g_DialogInfo, "Page: %i / %i", GetCategoryManagerPage(playerid, window) + 1, GetCategoryManagerMaxPage(playerid, window) + 1);
  916. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Category Manager: Page", g_DialogInfo, "Enter", "Cancel");
  917. }
  918. case DIALOGID_CATMANAGER_SEARCH_ALL, DIALOGID_CATMANAGER_SEARCH_CAT: {
  919. new bool:window = (dialogid == DIALOGID_CATMANAGER_SEARCH_ALL) ? CATMANAGER_WINDOW_ALL : CATMANAGER_WINDOW_CAT;
  920. GetCategoryManagerSearch(playerid, window, g_SearchString, sizeof g_SearchString);
  921. if( isempty(g_SearchString) ) {
  922. g_DialogInfo = "You are not searching for anything.";
  923. } else {
  924. format(g_DialogInfo, sizeof g_DialogInfo, "Searching for: %s", g_SearchString);
  925. }
  926. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Category Manager: Search", g_DialogInfo, "Enter", "Cancel");
  927. }
  928. default: {
  929. return 0;
  930. }
  931. }
  932. return 1;
  933. }
  934. GetCategoryManagerPage(playerid, bool:window) {
  935. new page;
  936. switch( window ) {
  937. case CATMANAGER_WINDOW_ALL: {
  938. page = g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_ALL];
  939. }
  940. case CATMANAGER_WINDOW_CAT: {
  941. page = g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_CAT];
  942. }
  943. }
  944. return page;
  945. }
  946. SetCategoryManagerPage(playerid, bool:window, page) {
  947. switch( window ) {
  948. case CATMANAGER_WINDOW_ALL: {
  949. g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_ALL] = page;
  950. }
  951. case CATMANAGER_WINDOW_CAT: {
  952. g_CatManagerData[playerid][CATMANAGER_DATA_PAGE_CAT] = page;
  953. }
  954. default: {
  955. return 0;
  956. }
  957. }
  958. return 1;
  959. }
  960. GetCategoryManagerSearch(playerid, bool:window, search[], search_size) {
  961. switch( window ) {
  962. case CATMANAGER_WINDOW_ALL: {
  963. strunpack(search, g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_ALL], search_size);
  964. }
  965. case CATMANAGER_WINDOW_CAT: {
  966. strunpack(search, g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_CAT], search_size);
  967. }
  968. default: {
  969. return 0;
  970. }
  971. }
  972. return 1;
  973. }
  974. SetCategoryManagerSearch(playerid, bool:window, search[]) {
  975. switch( window ) {
  976. case CATMANAGER_WINDOW_ALL: {
  977. strpack(g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_ALL], search, MAX_SEARCH_LEN+1);
  978. }
  979. case CATMANAGER_WINDOW_CAT: {
  980. strpack(g_CatManagerData[playerid][CATMANAGER_DATA_SEARCH_CAT], search, MAX_SEARCH_LEN+1);
  981. }
  982. default: {
  983. return 0;
  984. }
  985. }
  986. return 1;
  987. }
  988. GetCategoryManagerRowID(playerid, bool:window, row) {
  989. new id;
  990. switch( window ) {
  991. case CATMANAGER_WINDOW_ALL: {
  992. id = g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_ALL][row];
  993. }
  994. case CATMANAGER_WINDOW_CAT: {
  995. id = g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_CAT][row];
  996. }
  997. }
  998. return id;
  999. }
  1000. SetCategoryManagerRowID(playerid, bool:window, row, id) {
  1001. switch( window ) {
  1002. case CATMANAGER_WINDOW_ALL: {
  1003. g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_ALL][row] = id;
  1004. }
  1005. case CATMANAGER_WINDOW_CAT: {
  1006. g_CatManagerData[playerid][CATMANAGER_DATA_ROW_ID_CAT][row] = id;
  1007. }
  1008. default: {
  1009. return 0;
  1010. }
  1011. }
  1012. return 1;
  1013. }