Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.12 KB | None | 0 0
  1. case DIALOG_CLOTHES_BONE:
  2. {
  3. new id, string[128];
  4.  
  5. for(new i = 1; i < MAX_CLOTHING_ITEMS; i++)
  6. {
  7. if(ClothingData[playerid][i][attachment_SQLID] == ClothingHolder[playerid])
  8. id = i;
  9. }
  10.  
  11. if(response){
  12. switch(listitem){
  13. case 0:{
  14. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Spine", ClothingData[playerid][id][attachment_name], id);
  15. SendClientMessage(playerid, COLOR_WHITE, string);
  16.  
  17. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_SPINE;
  18. }
  19. case 1:{
  20. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Head", ClothingData[playerid][id][attachment_name], id);
  21. SendClientMessage(playerid, COLOR_WHITE, string);
  22.  
  23. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_HEAD;
  24. }
  25. case 2:{
  26. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Left arm", ClothingData[playerid][id][attachment_name], id);
  27. SendClientMessage(playerid, COLOR_WHITE, string);
  28.  
  29. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_LUPPER_A;
  30. }
  31. case 3:{
  32. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Right arm", ClothingData[playerid][id][attachment_name], id);
  33. SendClientMessage(playerid, COLOR_WHITE, string);
  34.  
  35. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_RUPPER_A;
  36. }
  37. case 4:{
  38. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Left hand", ClothingData[playerid][id][attachment_name], id);
  39. SendClientMessage(playerid, COLOR_WHITE, string);
  40.  
  41. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_LHAND;
  42. }
  43. case 5:{
  44. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Right hand", ClothingData[playerid][id][attachment_name], id);
  45. SendClientMessage(playerid, COLOR_WHITE, string);
  46.  
  47. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_RHAND;
  48. }
  49. case 6:{
  50. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Left thigh", ClothingData[playerid][id][attachment_name], id);
  51. SendClientMessage(playerid, COLOR_WHITE, string);
  52.  
  53. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_LTHIGH;
  54. }
  55. case 7:{
  56. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Right thigh", ClothingData[playerid][id][attachment_name], id);
  57. SendClientMessage(playerid, COLOR_WHITE, string);
  58.  
  59. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_RTHIGH;
  60. }
  61. case 8:{
  62. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Left foot", ClothingData[playerid][id][attachment_name], id);
  63. SendClientMessage(playerid, COLOR_WHITE, string);
  64.  
  65. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_LFOOT;
  66. }
  67. case 9:{
  68. format(string, sizeof(string), "You changed your %s(Index: %d) bone to Right foot", ClothingData[playerid][id][attachment_name], id);
  69. SendClientMessage(playerid, COLOR_WHITE, string);
  70.  
  71. ClothingData[playerid][id][attachment_bone] = OBJECT_BONE_RFOOT;
  72. }
  73. }
  74.  
  75. new
  76. thread[128];
  77.  
  78. mysql_format(m_Handle, thread, sizeof(thread), "UPDATE player_clothing SET bone = %i WHERE id = %i", ClothingData[playerid][id][attachment_bone], ClothingData[playerid][id][attachment_SQLID]);
  79. mysql_tquery(m_Handle, thread);
  80. }
  81. }
  82. case DIALOG_ADMIN_MSG:
  83. {
  84. if (response){
  85. PlayerData[playerid][pAdmMsgConfirm] = true;
  86.  
  87. format(PlayerData[playerid][pAdminMsg], 128, "");
  88. format(PlayerData[playerid][pAdminMsgBy], 60, "");
  89. }
  90. }
  91. case DIALOG_SECRET_WORD_CREATE:
  92. {
  93. new query[256];
  94.  
  95. if (!response) {
  96. SendClientMessage(playerid, COLOR_ADM, "You have been kicked for not setting your secret word.");
  97. printf("[DEBUG] %s was auto-kicked (Reason: Not logging in after 60s.)");
  98. KickEx(playerid);
  99. return true;
  100. }
  101.  
  102. mysql_format(m_Handle, query, sizeof(query), "UPDATE players SET SecretWord = sha1('%e') WHERE id = %i", inputtext, PlayerData[playerid][pSQLID]);
  103. mysql_pquery(m_Handle, query);
  104.  
  105. LoadPlayerData(playerid);
  106. SendClientMessage(playerid, COLOR_YELLOW, "Your connection to the server has been authenticated.");
  107. }
  108. case DIALOG_SECRET_WORD_ENTER:
  109. {
  110. new string[128], query[256];
  111.  
  112. if(!response) {
  113. SendClientMessage(playerid, COLOR_ADM, "You have been kicked for not logging in.");
  114.  
  115. format(string, sizeof(string), "%s was kicked during login (Did not confirm security password). Details logged", ReturnName(playerid, 1));
  116. adminWarn(1, string);
  117.  
  118. KickEx(playerid);
  119. return true;
  120. }
  121.  
  122. mysql_format(m_Handle, query, sizeof(query), "SELECT id FROM players WHERE Name = '%e' AND SecretWord = sha1('%e') LIMIT 1", ReturnName(playerid, 1), inputtext);
  123. mysql_pquery(m_Handle, query, "SQL_OnAccountConfirm", "i", playerid);
  124. }
  125. case DIALOG_GRAFFITI_MENU:
  126. {
  127. if (response)
  128. {
  129. switch(listitem)
  130. {
  131. case 0:
  132. {
  133. new string[289];
  134.  
  135. string = "USAGE:\n\n-\t\tIn this dialog, you may insert custom text to spray graffiti with. With this, there are custom bbCodes.\n\n\t\tNew line (n), Black (b), Brown(br) Red (r), Blue (bl), Green (g), Orange (o), White (w)\n\t\tYellow (y), Maroon (mr)\n-\t\t\nYour character may not be longer then 60 characters.";
  136.  
  137. format(string, sizeof(string), "%s", string);
  138.  
  139. ShowPlayerDialog(playerid, DIALOG_GRAFFITI_TEXT, DIALOG_STYLE_INPUT, "Enter your text:", string, "Odaberi", "<<");
  140. }
  141. case 1:
  142. {
  143. ShowPlayerDialog(playerid, DIALOG_GRAFFITI_FONT, DIALOG_STYLE_LIST, "Pick A Font:", "Comic Sans\nLevi Brush\nDripping\nDiploma", "Odaberi", "<<");
  144. }
  145. }
  146. }
  147. }
  148. case DIALOG_GRAFFITI_FONT:
  149. {
  150. if (response)
  151. {
  152. switch(listitem)
  153. {
  154. case 0:
  155. {
  156. format(graffitiFont[playerid], 60, "Comic Sans");
  157. SendClientMessage(playerid, COLOR_YELLOW, "You have chosen the font:{FFFFFF} Comic Sans");
  158. }
  159. case 1:
  160. {
  161. format(graffitiFont[playerid], 60, "Levi Brush");
  162. SendClientMessage(playerid, COLOR_YELLOW, "You have chosen the font:{FFFFFF} Levi Brush");
  163. }
  164. case 2:
  165. {
  166. format(graffitiFont[playerid], 60, "Dripping");
  167. SendClientMessage(playerid, COLOR_YELLOW, "You have chosen the font:{FFFFFF} Dripping");
  168. }
  169. case 3:
  170. {
  171. format(graffitiFont[playerid], 60, "Diploma");
  172. SendClientMessage(playerid, COLOR_YELLOW, "You have chosen the font:{FFFFFF} Diploma");
  173. }
  174. }
  175. }
  176. else return ShowPlayerDialog(playerid, DIALOG_GRAFFITI_MENU, DIALOG_STYLE_LIST, "Main Menu:", "Custom Graffiti Text\nChoose Your Font", "Odaberi", "<<");
  177. }
  178. case DIALOG_GRAFFITI_TEXT:
  179. {
  180. if (response)
  181. {
  182. new
  183. string[289]
  184. ;
  185.  
  186. string = "USAGE:\n\n-\tIn this dialog, you may insert custom text to spray graffiti with. With this, there are custom bbCodes.\n\n\t\tNew line (n), Black (b), Brown(br) Red (r), Blue (bl), Green (g), Orange (o), White (w)\n\t\tYellow (y), Maroon (mr)\n-\t\t\nYour character may not be longer then 60 characters.";
  187.  
  188. format(string, sizeof(string), "%s", string);
  189.  
  190. if(strlen(inputtext) >= 59)
  191. {
  192. SendClientMessage(playerid, COLOR_YELLOW, "Your graffiti text was over 60 characters.");
  193.  
  194. ShowPlayerDialog(playerid, DIALOG_GRAFFITI_TEXT, DIALOG_STYLE_INPUT, "Enter your text:", string, "Odaberi", "<<");
  195. return true;
  196. }
  197.  
  198. if(strlen(inputtext) < 1)
  199. {
  200. ShowPlayerDialog(playerid, DIALOG_GRAFFITI_TEXT, DIALOG_STYLE_INPUT, "Enter your text:", string, "Odaberi", "<<");
  201. return true;
  202. }
  203.  
  204. ShowPlayerDialog(playerid, DIALOG_GRAFFITI_TEXT, DIALOG_STYLE_INPUT, "Enter your text:", string, "Odaberi", "<<");
  205. format(graffitiText[playerid], 65, "%s", inputtext);
  206. format(graffitiTextSave[playerid], 65, "%s", inputtext);
  207.  
  208. sprayingGraffitiTime[playerid] = strlen(graffitiText[playerid]);
  209. saveSprayingTime[playerid] = sprayingGraffitiTime[playerid];
  210.  
  211. format(graffitiFont[playerid], 60, "Comic Sans");
  212. SendClientMessage(playerid, COLOR_YELLOW, "You have set your text!");
  213.  
  214. format(string, sizeof(string), "%s", graffitiText[playerid]);
  215. SendClientMessage(playerid, COLOR_WHITE, string);
  216. }
  217. else return ShowPlayerDialog(playerid, DIALOG_GRAFFITI_MENU, DIALOG_STYLE_LIST, "Main Menu:", "Custom Graffiti Text\nChoose Your Font", "Odaberi", "<<");
  218. }
  219. case DIALOG_FACTION_CLOTHING:
  220. {
  221. if(response){
  222. new id = listitem, clothing_id = FreeAttachmentSlot(playerid);
  223.  
  224. ApplyAnimation(playerid, "CLOTHES", "CLO_Pose_Hat", 4.1, 0, 0, 0, 1, 0, 1);
  225.  
  226. SendClientMessage(playerid, COLOR_WHITE, "HINT: Use {FFFF00}SPACE{FFFFFF} to look around. Press {FFFF00}ESC{FFFFFF} to decline.");
  227. SendClientMessage(playerid, COLOR_WHITE, "Use {FFFF00}/clothing{FFFFFF} to edit your clothing items.");
  228.  
  229. SetPlayerAttachedObject(playerid, clothing_id, g_aFactionClothing[id][clothingModel], 2);
  230. EditAttachedObject(playerid, clothing_id);
  231.  
  232. ClothingCost[playerid] = g_aFactionClothing[id][clothingPrice];
  233.  
  234. format(PlayerData[playerid][pClothingName], 90, "%s", g_aFactionClothing[id][clothingName]);
  235. PlayerData[playerid][pBuyingClothing] = true;
  236. }
  237. }
  238. case DIALOG_MDC:
  239. {
  240. if(response)
  241. {
  242. PlayNearbySound(playerid, MDC_SELECT);
  243.  
  244. switch(listitem)
  245. {
  246. case 0: return ShowPlayerDialog(playerid, DIALOG_MDC_NAME, DIALOG_STYLE_INPUT, "Name Search - MDC", "Enter the persons full legal name to search below:", "Odaberi", "<<");
  247. case 2: return ShowPlayerDialog(playerid, DIALOG_MDC_PLATE_FULL, DIALOG_STYLE_INPUT, "Plate Search - MDC", "Enter the vehicles full plate number to search below:", "Odaberi", "<<");
  248. case 3: return ShowPlayerDialog(playerid, DIALOG_MDC_PLATE_PARTIAL, DIALOG_STYLE_INPUT, "Partial Plate Search - MDC", "Enter a partial plate number to search below:", "Odaberi", "<<");
  249. case 5:
  250. {
  251. new
  252. primary[500], sub[128];
  253.  
  254. if(!TotalJailees)
  255. return ShowPlayerDialog(playerid, DIALOG_MDC_FINISH_QUEUE, DIALOG_STYLE_MSGBOX, "Prisoners List - MDC", "There are no prisoners at the time.", "<<", "");
  256.  
  257. foreach(new i : Player)
  258. {
  259. if(PlayerData[i][pICJailed])
  260. {
  261. format(sub, sizeof(sub), "%s\n", ReturnName(i));
  262. strcat(primary, sub);
  263. }
  264. }
  265.  
  266. format(sub, sizeof(sub), "{1E0C95}Total Prisoners: %i", TotalJailees);
  267. strcat(primary, sub);
  268.  
  269. ShowPlayerDialog(playerid, DIALOG_MDC_FINISH_QUEUE, DIALOG_STYLE_LIST, "Prisoners List - MDC", primary, ">>", "<<");
  270. }
  271. case 6:
  272. {
  273. return mysql_tquery(m_Handle, "SELECT ModelID, Plate, ReportedStolenDate FROM ownedcars WHERE ReportedStolen = 1 ORDER BY id DESC", "OnStolenCars", "i", playerid);
  274. }
  275. case 8: return ShowPlayerDialog(playerid, DIALOG_MDC_NUMBER_SEARCH, DIALOG_STYLE_INPUT, "Phone Search - MDC", "Enter the phone number you want to find the owner of:", "Odaberi", "<<");
  276. case 9:
  277. {
  278. new
  279. primary[900], sub[128],
  280. callsign[128], bool:found;
  281.  
  282. foreach(new i : Player)
  283. {
  284. if(!PlayerData[i][pLAWduty])
  285. continue;
  286.  
  287. format(callsign, 128, "- %s", PlayerData[i][pCallsign]);
  288.  
  289. format(sub, sizeof(sub), "%s %s\n", ReturnName(i), (strlen(PlayerData[i][pCallsign]) > 1) ? (callsign) : (""));
  290. strcat(primary, sub);
  291.  
  292. found = true;
  293. }
  294. if(!found)
  295. return ShowPlayerDialog(playerid, DIALOG_MDC_FINISH_QUEUE, DIALOG_STYLE_MSGBOX, "Duty Roster - MDC", "There's nobody on duty right now.", ">>", "<<");
  296.  
  297. ShowPlayerDialog(playerid, DIALOG_MDC_FINISH_QUEUE, DIALOG_STYLE_LIST, "Duty Roster - MDC", primary, ">>", "<<");
  298. }
  299. }
  300. }
  301. return 1;
  302. }
  303. case DIALOG_MDC_NAME:
  304. {
  305. if(response)
  306. {
  307. if(strlen(inputtext) < 3 || strlen(inputtext) > MAX_PLAYER_NAME + 1)
  308. return ShowPlayerDialog(playerid, DIALOG_MDC_NAME, DIALOG_STYLE_INPUT, "Name Search - MDC", "Enter the persons full legal name to search below:", "Odaberi", "<<");
  309.  
  310. for(new i = 0; i < strlen(inputtext); i++)
  311. {
  312. if(inputtext[i] == '_')
  313. {
  314. PlayNearbySound(playerid, MDC_ERROR);
  315. ShowPlayerDialog(playerid, DIALOG_MDC_NAME, DIALOG_STYLE_INPUT, "Name Search - MDC", "Enter the persons full legal name to search below:", "Odaberi", "<<");
  316. }
  317. else
  318. {
  319. if(inputtext[i] == ' ')
  320. {
  321. inputtext[i] = '_';
  322. }
  323. }
  324. }
  325.  
  326. PlayNearbySound(playerid, MDC_SELECT);
  327. format(PlayerMDCText[playerid], 32, "%s", inputtext);
  328.  
  329. new
  330. search_query[256];
  331.  
  332. mysql_format(m_Handle, search_query, sizeof(search_query), "SELECT Phone, DriversLicense, WeaponsLicense, ActiveListing, JailTimes, PrisonTimes FROM players WHERE Name = '%e'", inputtext);
  333. mysql_tquery(m_Handle, search_query, "OnMDCNameSearch", "i", playerid);
  334. return 1;
  335. }
  336. else ShowPlayerMDC(playerid);
  337. }
  338. case DIALOG_MDC_PLATE_FULL:
  339. {
  340. if(response)
  341. {
  342. if(strlen(inputtext) > 7 || strlen(inputtext) < 7)
  343. {
  344. PlayNearbySound(playerid, MDC_ERROR);
  345. return ShowPlayerDialog(playerid, DIALOG_MDC_PLATE_FULL, DIALOG_STYLE_INPUT, "Plate Search - MDC", "Enter the vehicles full plate number to search below:", "Odaberi", "<<");
  346. }
  347.  
  348. PlayNearbySound(playerid, MDC_SELECT);
  349. format(PlayerMDCText[playerid], 32, "%s", inputtext);
  350.  
  351. new
  352. search_query[256];
  353.  
  354. mysql_format(m_Handle, search_query, sizeof(search_query), "SELECT OwnerID, ModelID, Impounded, Insurance, ReportedStolen, ReportedStolenDate FROM ownedcars WHERE Plate = '%e'", inputtext);
  355. mysql_tquery(m_Handle, search_query, "OnMDCPlateSearch", "i", playerid);
  356. return 1;
  357. }
  358. else return ShowPlayerMDC(playerid);
  359. }
  360. case DIALOG_MDC_PLATE_PARTIAL:
  361. {
  362. if(response)
  363. {
  364. if(strlen(inputtext) < 3 || strlen(inputtext) > 7)
  365. {
  366. PlayNearbySound(playerid, MDC_ERROR);
  367. return ShowPlayerDialog(playerid, DIALOG_MDC_PLATE_PARTIAL, DIALOG_STYLE_INPUT, "Partial Plate Search - MDC", "Partial plates must have at least 3 characters.\n\nEnter a partial plate number to search below:", "Odaberi", "<<");
  368. }
  369.  
  370. PlayNearbySound(playerid, MDC_SELECT);
  371. format(PlayerMDCText[playerid], 32, "%s", inputtext);
  372.  
  373. new
  374. search_query[128];
  375.  
  376. mysql_format(m_Handle, search_query, sizeof(search_query), "SELECT Plate FROM ownedcars WHERE Plate LIKE '%%%e%%' LIMIT 5", inputtext);
  377. mysql_tquery(m_Handle, search_query, "OnMDCPartialPlate", "i", playerid);
  378. return 1;
  379. }
  380. else return ShowPlayerMDC(playerid);
  381. }
  382. case DIALOG_MDC_PLATE_LIST:
  383. {
  384. if(response)
  385. {
  386. new
  387. search_query[230];
  388.  
  389. PlayNearbySound(playerid, MDC_SELECT);
  390. format(PlayerMDCText[playerid], 32, "%s", PlayerMDCPlateHolder[playerid][listitem]);
  391.  
  392. mysql_format(m_Handle, search_query, sizeof(search_query), "SELECT OwnerID, ModelID, Impounded, Insurance, ReportedStolen, ReportedStolenDate FROM ownedcars WHERE Plate = '%e'", PlayerMDCPlateHolder[playerid][listitem]);
  393. mysql_tquery(m_Handle, search_query, "OnMDCPlateSearch", "i", playerid);
  394. return 1;
  395. }
  396. else return ShowPlayerMDC(playerid);
  397. }
  398. case DIALOG_MDC_NUMBER_SEARCH:
  399. {
  400. if(response)
  401. {
  402. if(!IsNumeric(inputtext))
  403. return ShowPlayerDialog(playerid, DIALOG_MDC_NUMBER_SEARCH, DIALOG_STYLE_INPUT, "Phone Search - MDC", "Enter the phone number you want to find the owner of:", "Odaberi", "<<");
  404.  
  405. new
  406. number,
  407. thread[128];
  408.  
  409. if(strlen(inputtext) > 6)
  410. return ShowPlayerDialog(playerid, DIALOG_MDC_NUMBER_SEARCH, DIALOG_STYLE_INPUT, "Phone Search - MDC", "Enter the phone number you want to find the owner of:", "Odaberi", "<<");
  411.  
  412. number = strval(inputtext);
  413.  
  414. mysql_format(m_Handle, thread, sizeof(thread), "SELECT Name FROM players WHERE Phone = %i", number);
  415. mysql_tquery(m_Handle, thread, "OnPhoneSearch", "ii", playerid, number);
  416. }
  417. else return ShowPlayerMDC(playerid);
  418. }
  419. case DIALOG_MDC_FINISH_QUEUE:
  420. {
  421. if(response)
  422. return ShowPlayerMDC(playerid);
  423.  
  424. return 1;
  425. }
  426. case DIALOG_FINES:
  427. {
  428. if(response)
  429. { //{105289} ADC3E7
  430.  
  431. if(!strcmp(inputtext, "**Click here to clear a fine."))
  432. {
  433. if(PlayerData[playerid][pFactionRank] > FactionData[PlayerData[playerid][pFaction]][factionEditrank])
  434. return ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Fines", "Your rank doesn't have permission to clear fines.", ">>", "<<");
  435.  
  436. return ShowPlayerDialog(playerid, DIALOG_FINES_DELETE, DIALOG_STYLE_INPUT, "Clear a fine:", "Enter the Fine's # ID to clear it.", "Odaberi", "Exit");
  437. }
  438.  
  439. new
  440. str[128], id;
  441.  
  442. id = CheckingPlayerFine[playerid];
  443.  
  444. SendClientMessage(playerid, COLOR_GRAD1, "- - - - - - - - PRINTED FINE - - - - - - - -");
  445.  
  446. format(str, sizeof(str), "{105289}Fine #. ID:{ADC3E7} %i", Fines[id][listitem][Fine_ID]);
  447. SendClientMessage(playerid, -1, str);
  448.  
  449. format(str, sizeof(str), "{105289}Fine Recipient:{ADC3E7} %s", ReturnName(id, 1));
  450. SendClientMessage(playerid, -1, str);
  451.  
  452. ClearLines(playerid, 1);
  453.  
  454. format(str, sizeof(str), "{105289}Fine Issuer:{ADC3E7} %s", Fines[id][listitem][Fine_Issuer]);
  455. SendClientMessage(playerid, -1, str);
  456.  
  457. format(str, sizeof(str), "{105289}Fine Amount:{ADC3E7} $%s", MoneyFormat(Fines[id][listitem][Fine_Amount]));
  458. SendClientMessage(playerid, -1, str);
  459.  
  460. ClearLines(playerid, 1);
  461.  
  462. format(str, sizeof(str), "{105289}Fine Reason:{ADC3E7} %s", Fines[id][listitem][Fine_Reason]);
  463. SendClientMessage(playerid, -1, str);
  464.  
  465. format(str, sizeof(str), "{105289}Issued Date:{ADC3E7} %s", Fines[id][listitem][Fine_Date]);
  466. SendClientMessage(playerid, -1, str);
  467.  
  468. SendClientMessage(playerid, COLOR_GRAD1, "- - - - - - - - - - - - - - - - - - - - - -");
  469. return 1;
  470. }
  471. return 1;
  472. }
  473. case DIALOG_FINES_DELETE:
  474. {
  475. if(response)
  476. {
  477. new
  478. id,
  479. bool:found = false,
  480. query[128]
  481. ;
  482.  
  483. if(!IsNumeric(inputtext))
  484. return ShowPlayerDialog(playerid, DIALOG_FINES_DELETE, DIALOG_STYLE_INPUT, "Clear a fine:", "Enter the Fine's # ID to clear it.", "Odaberi", "Exit");
  485.  
  486. id = strval(inputtext);
  487.  
  488.  
  489. foreach(new i : Player)
  490. {
  491. for(new f = 0; f < 30; f++)
  492. {
  493. if(Fines[i][f][Fine_ID] == id)
  494. {
  495. found = true;
  496. }
  497. }
  498. }
  499.  
  500. if(!found)
  501. return ShowPlayerDialog(playerid, DIALOG_FINES_DELETE, DIALOG_STYLE_INPUT, "Clear a fine:", "THAT FINE DOESN'T EXIST!\n\nEnter the Fine's # ID to clear it.", "Odaberi", "Exit");
  502.  
  503. else
  504. {
  505. mysql_format(m_Handle, query, sizeof(query), "DELETE FROM player_fines WHERE id = %i", id);
  506. mysql_tquery(m_Handle, query, "OnDeletePlayerFine", "ii", playerid, id);
  507. }
  508. return 1;
  509. }
  510. return 1;
  511. }
  512. case DIALOG_ROADBLOCKS:
  513. {
  514. if(response)
  515. {
  516. new
  517. liststr[500];
  518.  
  519. switch(listitem)
  520. {
  521. case 0:
  522. {
  523. for(new i = 0; i < sizeof(g_aRoadblocks); i++)
  524. {
  525. format(liststr, sizeof(liststr), "%s%s\n", liststr, g_aRoadblocks[i][RoadblockName]);
  526. }
  527. ShowPlayerDialog(playerid, DIALOG_ROADBLOCK_LIST, DIALOG_STYLE_LIST, "Available Roadblocks:", liststr, "Odaberi", "<<");
  528. }
  529. case 1:
  530. {
  531. new
  532. foundRoadblock;
  533.  
  534. for(new i = 0; i < sizeof(Roadblocks); i++)
  535. {
  536. if(!Roadblocks[i][RoadblockExists])
  537. continue;
  538.  
  539. foundRoadblock++;
  540. format(liststr, sizeof(liststr), "%s%s {AFAFAF}[%s - %s]\n", liststr, GetRoadblockNameFromModel(Roadblocks[i][RoadblocksModelID]), Roadblocks[i][RoadblockPlacedBy], Roadblocks[i][RoadblockLocation]);
  541. }
  542.  
  543. if(foundRoadblock) return ShowPlayerDialog(playerid, DIALOG_ACTIVE_ROADBLOCKS, DIALOG_STYLE_LIST, "Active Roadblocks:", liststr, "Odaberi", "<<");
  544. else return ShowPlayerDialog(playerid, DIALOG_ROADBLOCKS, DIALOG_STYLE_LIST, "Roadblocks Menu", "Deploy Roadblock\nRoadblock List", "Odaberi", "Odustani");
  545. }
  546. }
  547. }
  548. return 1;
  549. }
  550. case DIALOG_ROADBLOCK_LIST:
  551. {
  552. if(response)
  553. {
  554. new
  555. foundRoom = 1,
  556. count;
  557.  
  558. for(new i = 0; i < sizeof(Roadblocks); i++)
  559. {
  560. if(!Roadblocks[i][RoadblockExists])
  561. continue;
  562.  
  563. count++;
  564. if(count >= 29)
  565. foundRoom = 0;
  566. }
  567.  
  568. if(!foundRoom)
  569. {
  570. SendClientMessage(playerid, COLOR_WHITE, "SERVER: It's not possible to spawn anymore roadblocks right now.");
  571. return ShowPlayerDialog(playerid, DIALOG_ROADBLOCKS, DIALOG_STYLE_LIST, "Roadblocks Menu", "Deploy Roadblock\nRoadblock List", "Odaberi", "Odustani");
  572. }
  573.  
  574. new
  575. Float:x,
  576. Float:y,
  577. Float:z, str[128];
  578. GetPlayerPos(playerid, x, y, z);
  579.  
  580. PlayerData[playerid][pRoadblockObject] = CreateDynamicObject(g_aRoadblocks[listitem][RoadblockModel], x + 2, y, z, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), playerid);
  581. PlayerData[playerid][pAddingRoadblock] = 1;
  582. PlayerData[playerid][pRoadblockModel] = g_aRoadblocks[listitem][RoadblockModel];
  583. EditDynamicObject(playerid, PlayerData[playerid][pRoadblockObject]);
  584.  
  585. format(str, 128, "SERVER: You're adding a {ADC3E7}%s{FFFFFF} roadblock. Set the position to spawn it.", GetRoadblockNameFromModel(g_aRoadblocks[listitem][RoadblockModel]));
  586. SendClientMessage(playerid, -1, str);
  587. }
  588. else return ShowPlayerDialog(playerid, DIALOG_ROADBLOCKS, DIALOG_STYLE_LIST, "Roadblocks Menu", "Deploy Roadblock\nRoadblock List", "Odaberi", "Odustani");
  589. return 1;
  590. }
  591. case DIALOG_ACTIVE_ROADBLOCKS:
  592. {
  593. if(response)
  594. {
  595. new
  596. primary[350],
  597. detailstr[128];
  598.  
  599. format(detailstr, 128, "{ADC3E7}Roadblock:{FFFFFF} %s\n", GetRoadblockNameFromModel(Roadblocks[listitem][RoadblocksModelID]));
  600. strcat(primary, detailstr);
  601.  
  602. format(detailstr, 128, "{ADC3E7}Location:{FFFFFF} %s\n", Roadblocks[listitem][RoadblockLocation]);
  603. strcat(primary, detailstr);
  604.  
  605. format(detailstr, 128, "{ADC3E7}Placed by:{FFFFFF} %s\n\n", Roadblocks[listitem][RoadblockPlacedBy]);
  606. strcat(primary, detailstr);
  607.  
  608. strcat(primary, "Click '{ADC3E7}Yes{FFFFFF}' to disband this roadblock.");
  609.  
  610. ConfirmDialog(playerid, "Roadblock:", primary, "OnRoadblockDisband", listitem);
  611. }
  612. else return ShowPlayerDialog(playerid, DIALOG_ROADBLOCKS, DIALOG_STYLE_LIST, "Roadblocks Menu", "Deploy Roadblock\nRoadblock List", "Odaberi", "Odustani");
  613. return 1;
  614. }
  615. case DIALOG_FORUM_NAME:
  616. {
  617. if(response)
  618. {
  619. if(strlen(inputtext) > 60)
  620. return ShowPlayerDialog(playerid, DIALOG_FORUM_NAME, DIALOG_STYLE_INPUT, "ADMIN FORUM NAME:", "{FFFF00}You're missing your forum name. As an admin, it's required to have one. Type in your forum name:", "Odaberi", "Exit");
  621.  
  622. if(!strcmp(inputtext, "Kane", true) && PlayerData[playerid][pSQLID] != 1)
  623. return ShowPlayerDialog(playerid, DIALOG_FORUM_NAME, DIALOG_STYLE_INPUT, "ADMIN FORUM NAME:", "YOU AREN'T KANE.\n\n{FFFF00}You're missing your forum name. As an admin, it's required to have one. Type in your forum name:", "Odaberi", "Exit");
  624.  
  625. return cmd_forumname(playerid, inputtext);
  626. }
  627. return 1;
  628. }
  629. case DIALOG_INTERIORS:
  630. {
  631. if(response)
  632. {
  633. SetPlayerPos(playerid, Interiors[listitem][IntPosX], Interiors[listitem][IntPosY], Interiors[listitem][IntPosZ]);
  634. SetPlayerInterior(playerid, Interiors[listitem][IntID]);
  635.  
  636. SendClientMessage(playerid, COLOR_GREY, "You have been teleported");
  637. ResetHouseVar(playerid);
  638. return 1;
  639. }
  640. return 1;
  641. }
  642. case DIALOG_VLOG_LIST:
  643. {
  644. if(response)
  645. {
  646. if(listitem == 0)
  647. {
  648. if(PlayerVlogPage[playerid] == 1)
  649. ShowVehicleLogs(playerid, PlayerVlogVehicle[playerid], 1);
  650.  
  651. else
  652. ShowVehicleLogs(playerid, PlayerVlogVehicle[playerid], PlayerVlogPage[playerid]-1);
  653.  
  654. return 1;
  655. }
  656. if(listitem == MAX_VLOG_PER_PAGE+1){
  657. return ShowVehicleLogs(playerid, PlayerVlogVehicle[playerid], PlayerVlogPage[playerid]+1);
  658. }
  659. }
  660. return 1;
  661. }
  662. case DIALOG_PLOG_LIST:
  663. {
  664. if(response)
  665. {
  666. if(listitem == 0)
  667. {
  668. if(PlayerLogPage[playerid] == 1)
  669. ShowPlayerLogs(playerid, PlayerLogPlayer[playerid], 1);
  670.  
  671. else
  672. ShowPlayerLogs(playerid, PlayerLogPlayer[playerid], PlayerLogPage[playerid]-1);
  673.  
  674. return 1;
  675. }
  676. if(listitem == MAX_PLOG_PER_PAGE+1)
  677. return ShowPlayerLogs(playerid, PlayerLogPlayer[playerid], PlayerLogPage[playerid]+1);
  678. }
  679. }
  680. case DIALOG_REPORTS:
  681. {
  682. if(response)
  683. {
  684. new
  685. primary_str[300],
  686. sub_str[128];
  687.  
  688. format(sub_str, sizeof(sub_str), "Report ID: %i\n", listitem + 1);
  689. strcat(primary_str, sub_str);
  690.  
  691. format(sub_str, sizeof(sub_str), "Reporter: %s\n", ReturnSQLName(ReportData[listitem + 1][reportBy]));
  692. strcat(primary_str, sub_str);
  693.  
  694. format(sub_str, sizeof(sub_str), "Details: %s\n", ReportData[listitem + 1][reportReason]);
  695. strcat(primary_str, sub_str);
  696.  
  697. format(sub_str, sizeof(sub_str), "Pending time: %d Seconds\n\n", gettime() - ReportData[listitem + 1][reportTime]);
  698. strcat(primary_str, sub_str);
  699.  
  700. strcat(primary_str, "{A52A2A}Accept(Yes) or disregard(No) this report with the buttons.");
  701.  
  702. ConfirmDialog(playerid, "{A52A2A}Accept/disregard Report", primary_str, "OnSelectReport", listitem + 1);
  703. return 1;
  704. }
  705. return 1;
  706. }
  707. case DIALOG_ADMINSYS:
  708. {
  709. if(response)
  710. {
  711. ShowAdminSys(playerid, listitem);
  712. return 1;
  713. }
  714. return 1;
  715. }
  716. case DIALOG_ASYS_OFFLINEBAN:
  717. {
  718. if(!response)
  719. return ShowAdminPanel(playerid);
  720.  
  721. if(!IsValidRoleplayName(inputtext))
  722. return ShowAdminSys(playerid, 0, "The name you inputted is not a valid username.");
  723.  
  724. new
  725. strin[128];
  726.  
  727. if(!ReturnSQLFromName(inputtext))
  728. {
  729. format(strin, sizeof(strin), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" does not exist in the database.", inputtext);
  730. ShowAdminSys(playerid, 0, strin);
  731. return 1;
  732. }
  733.  
  734. if(IsUserBanned(inputtext))
  735. {
  736. format(strin, sizeof(strin), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" is already banned from the server.", inputtext);
  737. ShowAdminSys(playerid, 0, strin);
  738. return 1;
  739. }
  740.  
  741. foreach(new i : Player)
  742. {
  743. if(!strcmp(ReturnName(i), inputtext, true))
  744. {
  745. format(strin, sizeof(strin), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" is logged in as ID %i.", inputtext, i);
  746. ShowAdminSys(playerid, 0, strin);
  747. return 1;
  748. }
  749. }
  750.  
  751. format(OfflineBanName[playerid], 128, "%s", inputtext);
  752.  
  753. format(strin, 128, "Input the ban reason for user \"{A52A2A}%s{ADC3E7}\":", inputtext);
  754. ShowPlayerDialog(playerid, DIALOG_ASYS_BANREASON, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  755. return 1;
  756. }
  757. case DIALOG_ASYS_BANREASON:
  758. {
  759. if(!response)
  760. return ShowAdminPanel(playerid);
  761.  
  762. if(strlen(inputtext) < 3)
  763. {
  764. new
  765. strin[128];
  766.  
  767. format(strin, 128, "Input the ban reason for user \"{A52A2A}%s{ADC3E7}\":", OfflineBanName[playerid]);
  768. ShowPlayerDialog(playerid, DIALOG_ASYS_BANREASON, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  769. return 1;
  770. }
  771.  
  772. foreach(new i : Player)
  773. {
  774. if(!strcmp(ReturnName(i), OfflineBanName[playerid], true))
  775. {
  776. SendClientMessage(playerid, COLOR_ADM, "An error occurred... The player you were banning has logged in.");
  777. Message(playerid, COLOR_WHITE, "ID: %i", i);
  778. return 1;
  779. }
  780. }
  781.  
  782. new
  783. secure[160],
  784. admin_level, IP[60], HWID[90];
  785.  
  786. mysql_format(m_Handle, secure, sizeof(secure), "SELECT AdminLevel, IP, HWID FROM players WHERE Name = '%e'", OfflineBanName[playerid]);
  787. new Cache:cache = mysql_query(m_Handle, secure);
  788.  
  789. admin_level = cache_get_field_content_int(0, "AdminLevel", m_Handle);
  790.  
  791. cache_get_field_content(0, "IP", IP, m_Handle, 60);
  792. cache_get_field_content(0, "HWID", HWID, m_Handle, 90);
  793.  
  794. if(admin_level > PlayerData[playerid][pAdmin])
  795. {
  796. cache_delete(cache);
  797. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_MSGBOX, "Error processing", "The user specified cannot be banned by you.", "Okay", "");
  798. return 1;
  799. }
  800.  
  801. new
  802. query[300],
  803. string[128];
  804.  
  805. mysql_format(m_Handle, query, sizeof(query), "INSERT INTO bans (`Name`, `Reason`, `BannedBy`, `Date`, `IP`, `HWID`) VALUES('%e', '%e', '%e', '%e', '%e', '%e')", OfflineBanName[playerid], inputtext, ReturnName(playerid, 1), ReturnDateLog(), IP, HWID);
  806. mysql_pquery(m_Handle, query);
  807.  
  808. mysql_format(m_Handle, query, sizeof(query), "INSERT INTO log_bans (Name, Reason, BannedBy, Date, IP) VALUES('%e', '%e', '%e', '%e', '%e')", OfflineBanName[playerid], inputtext, ReturnName(playerid), ReturnDate(), IP);
  809. mysql_pquery(m_Handle, query);
  810.  
  811. format(string, sizeof(string), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" has successfully been banned.", OfflineBanName[playerid]);
  812. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_MSGBOX, "Administration panel", string, "Okay!", "");
  813.  
  814. format(string, sizeof(string), "%s was offline banned by %s for '%s'", OfflineBanName[playerid], ReturnName(playerid), inputtext);
  815. adminWarn(1, string);
  816.  
  817. format(string, sizeof(string), "4[LEADS]1%s offline banned %s", ReturnName(playerid), OfflineBanName[playerid]);
  818. IRC_GroupSay(groupLeads, IRC_CHANNEL_LEADS, string);
  819.  
  820. printf("[WARNING] AdmCmd: %s offline banned %s, reason: %s ", ReturnName(playerid, 1), OfflineBanName[playerid], inputtext);
  821. WriteLog("admin_logs/punishments/ban_log.txt", "[%s] %s was banned by %s, Reason: %s (OFFLINE)", ReturnDate(), OfflineBanName[playerid], ReturnName(playerid), inputtext);
  822.  
  823. cache_delete(cache);
  824. return 1;
  825. }
  826. case DIALOG_ASYS_OFFLINEAJAIL:
  827. {
  828. if(!response)
  829. return ShowAdminPanel(playerid);
  830.  
  831. if(!IsValidRoleplayName(inputtext))
  832. return ShowAdminSys(playerid, 0, "The name you inputted is not a valid username.");
  833.  
  834. new
  835. strin[128];
  836.  
  837. if(!ReturnSQLFromName(inputtext))
  838. {
  839. format(strin, sizeof(strin), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" does not exist in the database.", inputtext);
  840. ShowAdminSys(playerid, 1, strin);
  841. return 1;
  842. }
  843.  
  844. foreach(new i : Player)
  845. {
  846. if(!strcmp(ReturnName(i), inputtext, true))
  847. {
  848. format(strin, sizeof(strin), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" is logged in as ID %i.", inputtext, i);
  849. ShowAdminSys(playerid, 0, strin);
  850. return 1;
  851. }
  852. }
  853.  
  854. format(OfflineJailName[playerid], 60, "%s", inputtext);
  855.  
  856. format(strin, sizeof(strin), "Input the time you want to admin jail \"{A52A2A}%s{ADC3E7}\" for:", inputtext);
  857. ShowPlayerDialog(playerid, DIALOG_ASYS_OJAILTIME, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  858. return 1;
  859. }
  860. case DIALOG_ASYS_OJAILTIME:
  861. {
  862. if(!response)
  863. return ShowAdminPanel(playerid);
  864.  
  865. new
  866. strin[230];
  867.  
  868. if(!IsNumeric(inputtext))
  869. {
  870. format(strin, sizeof(strin), "The time must be a numeric value in minutes.\n\nInput the time you want to admin jail \"{A52A2A}%s{ADC3E7}\" for:", OfflineJailName[playerid]);
  871. ShowPlayerDialog(playerid, DIALOG_ASYS_OJAILTIME, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  872. return 1;
  873. }
  874.  
  875. OfflineJailTime[playerid] = strval(inputtext);
  876.  
  877. if(OfflineJailTime[playerid] < 1)
  878. {
  879. if(!IsNumeric(inputtext))
  880. {
  881. format(strin, sizeof(strin), "The time must be a numeric value in minutes. (1+)\n\nInput the time you want to admin jail \"{A52A2A}%s{ADC3E7}\" for:", OfflineJailName[playerid]);
  882. ShowPlayerDialog(playerid, DIALOG_ASYS_OJAILTIME, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  883. return 1;
  884. }
  885. }
  886.  
  887. format(strin, sizeof(strin), "Input the reason for \"{A52A2A}%s{ADC3E7}\"'s (%i) minute admin jail:", OfflineJailName[playerid], OfflineJailTime[playerid]);
  888. ShowPlayerDialog(playerid, DIALOG_ASYS_OJAILREASON, DIALOG_STYLE_INPUT, "Administration panel", strin, "Odaberi", "<<");
  889. return 1;
  890. }
  891. case DIALOG_ASYS_OJAILREASON:
  892. {
  893. if(!response)
  894. return ShowAdminPanel(playerid);
  895.  
  896. new
  897. query[256],
  898. string[170];
  899.  
  900. mysql_format(m_Handle, query, sizeof(query), "UPDATE players SET OfflineAjail = 1, AjailTime = %d, OfflineAjailReason = '%e' WHERE Name = '%e'", OfflineJailTime[playerid], inputtext, OfflineJailName[playerid]);
  901. mysql_pquery(m_Handle, query);
  902.  
  903. format(string, sizeof(string), "{ADC3E7}The username \"{A52A2A}%s{ADC3E7}\" has successfully been admin jailed.", OfflineJailName[playerid]);
  904. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_MSGBOX, "Administration panel", string, "Okay!", "");
  905.  
  906. format(string, sizeof(string), "%s was offline jailed by %s for '%s'", OfflineJailName[playerid], ReturnName(playerid), inputtext);
  907. adminWarn(1, string);
  908.  
  909. WriteLog("admin_logs/punishments/ajail_log.txt", "[%s] %s offline jailed %s for %d minutes, reason: %s (OFFLINE)", ReturnDate(), ReturnName(playerid, 1), OfflineJailName[playerid], OfflineJailTime[playerid], inputtext);
  910.  
  911. mysql_format(m_Handle, query, sizeof(query), "INSERT INTO log_ajail (`Name`, `Reason`, `JailedBy`, `Date`, `Time`, `IP`) VALUES('%e', '%e', '%e', '%e', %i, 'via off')", OfflineJailName[playerid], inputtext, ReturnName(playerid, 1), ReturnDateLog(), OfflineJailTime[playerid]);
  912. mysql_pquery(m_Handle, query);
  913. return 1;
  914. }
  915. case DIALOG_ASYS_UNBAN:
  916. {
  917. if(!response)
  918. return ShowAdminPanel(playerid);
  919.  
  920. if(!IsValidRoleplayName(inputtext))
  921. {
  922. ShowAdminSys(playerid, 2, "The username you specified isn't possible.");
  923. return 1;
  924. }
  925.  
  926. if(!ReturnSQLFromName(inputtext))
  927. {
  928. ShowAdminSys(playerid, 2, "The username you specified doesn't exist in the database.");
  929. return 1;
  930. }
  931.  
  932. new
  933. string[128];
  934.  
  935. foreach(new i : Player)
  936. {
  937. if(!strcmp(ReturnName(i), inputtext, true))
  938. {
  939. format(string, sizeof(string), "The user you specified is logged in as ID %i.", i);
  940. ShowAdminSys(playerid, 2, string);
  941. return 1;
  942. }
  943. }
  944.  
  945. if(!IsUserBanned(inputtext))
  946. {
  947. format(string, sizeof(string), "The user \"{A52A2A}%s{ADC3E7}\" is not banned from the server.", inputtext);
  948. ShowAdminSys(playerid, 2, string);
  949. return 1;
  950. }
  951.  
  952. format(AdminPanelName[playerid], 60, "%s", inputtext);
  953.  
  954. format(string, sizeof(string), "Are you sure you want to unban \"{A52A2A}%s{ADC3E7}\" from the server?", inputtext);
  955. ConfirmDialog(playerid, "Administration panel", string, "OnPanelUnban");
  956. return 1;
  957. }
  958. case DIALOG_LOOKUP_JAILS:
  959. {
  960. if(!response)
  961. return ShowAdminPanel(playerid);
  962.  
  963. if(!IsValidRoleplayName(inputtext))
  964. {
  965. ShowAdminSys(playerid, 3, "The username you specified isn't possible.");
  966. return 1;
  967. }
  968.  
  969. if(!ReturnSQLFromName(inputtext))
  970. {
  971. ShowAdminSys(playerid, 3, "The username you specified doesn't exist in the database.");
  972. return 1;
  973. }
  974.  
  975. new
  976. query[200];
  977.  
  978. mysql_format(m_Handle, query, sizeof(query), "SELECT * FROM log_ajail WHERE Name = '%e' ORDER BY id DESC", inputtext);
  979. new Cache:cache = mysql_query(m_Handle, query);
  980.  
  981. if(!cache_num_rows())
  982. {
  983. format(query, sizeof(query), "The user \"{A52A2A}%s{ADC3E7}\" has never been admin jailed.", inputtext);
  984. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", query, "Okay!", "");
  985.  
  986. cache_delete(cache);
  987. return 1;
  988. }
  989. else
  990. {
  991. new Reason[128], By[60], Date[90], IP[90], Time;
  992. new PackerString[128], FullList[1100];
  993.  
  994. strcat(FullList, "Jailed by - Date - Time - Reason - IP\n\n");
  995.  
  996. for(new i = 0; i < cache_num_rows(); i++)
  997. {
  998. cache_get_field_content(i, "JailedBy", By, m_Handle, 60);
  999. cache_get_field_content(i, "Reason", Reason, m_Handle, 128);
  1000.  
  1001. cache_get_field_content(i, "Date", Date, m_Handle, 90);
  1002. cache_get_field_content(i, "IP", IP, m_Handle, 90);
  1003.  
  1004. Time = cache_get_field_content_int(i, "Time", m_Handle);
  1005.  
  1006. format(PackerString, 128, "\t%s - %s - %i - %s - %s\n", By, Date, Time, Reason, IP);
  1007. strcat(FullList, PackerString);
  1008. }
  1009.  
  1010. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", FullList, "Okay!", "");
  1011. }
  1012. return 1;
  1013. }
  1014. case DIALOG_LOOKUP_KICKS:
  1015. {
  1016. if(!response)
  1017. return ShowAdminPanel(playerid);
  1018.  
  1019. if(!IsValidRoleplayName(inputtext))
  1020. {
  1021. ShowAdminSys(playerid, 4, "The username you specified isn't possible.");
  1022. return 1;
  1023. }
  1024.  
  1025. if(!ReturnSQLFromName(inputtext))
  1026. {
  1027. ShowAdminSys(playerid, 4, "The username you specified doesn't exist in the database.");
  1028. return 1;
  1029. }
  1030.  
  1031. new
  1032. query[200];
  1033.  
  1034. mysql_format(m_Handle, query, sizeof(query), "SELECT * FROM log_kicks WHERE Name = '%e' ORDER BY id DESC", inputtext);
  1035. new Cache:cache = mysql_query(m_Handle, query);
  1036.  
  1037. if(!cache_num_rows())
  1038. {
  1039. format(query, sizeof(query), "The user \"{A52A2A}%s{ADC3E7}\" has never been kicked.", inputtext);
  1040. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", query, "Okay!", "");
  1041.  
  1042. cache_delete(cache);
  1043. return 1;
  1044. }
  1045. else
  1046. {
  1047. new Reason[128], By[60], Date[90], IP[90];
  1048. new PackerString[128], FullList[1100];
  1049.  
  1050. strcat(FullList, "Kicked by - Date - Reason - IP\n\n");
  1051.  
  1052. for(new i = 0; i < cache_num_rows(); i++)
  1053. {
  1054. cache_get_field_content(i, "KickedBy", By, m_Handle, 60);
  1055. cache_get_field_content(i, "Reason", Reason, m_Handle, 128);
  1056.  
  1057. cache_get_field_content(i, "Date", Date, m_Handle, 90);
  1058. cache_get_field_content(i, "IP", IP, m_Handle, 90);
  1059.  
  1060. format(PackerString, 128, "\t%s - %s - %s - %s\n", By, Date, Reason, IP);
  1061. strcat(FullList, PackerString);
  1062. }
  1063.  
  1064. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", FullList, "Okay!", "");
  1065. }
  1066. return 1;
  1067. }
  1068. case DIALOG_LOOKUP_BANS:
  1069. {
  1070. if(!response)
  1071. return ShowAdminPanel(playerid);
  1072.  
  1073. if(!IsValidRoleplayName(inputtext))
  1074. {
  1075. ShowAdminSys(playerid, 5, "The username you specified isn't possible.");
  1076. return 1;
  1077. }
  1078.  
  1079. if(!ReturnSQLFromName(inputtext))
  1080. {
  1081. ShowAdminSys(playerid, 5, "The username you specified doesn't exist in the database.");
  1082. return 1;
  1083. }
  1084.  
  1085. new
  1086. query[200];
  1087.  
  1088. mysql_format(m_Handle, query, sizeof(query), "SELECT * FROM log_bans WHERE Name = '%e' ORDER BY id DESC", inputtext);
  1089. new Cache:cache = mysql_query(m_Handle, query);
  1090.  
  1091. if(!cache_num_rows())
  1092. {
  1093. format(query, sizeof(query), "The user \"{A52A2A}%s{ADC3E7}\" has never been banned.", inputtext);
  1094. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", query, "Okay!", "");
  1095.  
  1096. cache_delete(cache);
  1097. return 1;
  1098. }
  1099. else
  1100. {
  1101. new Reason[128], By[60], Date[90], IP[90];
  1102. new PackerString[128], FullList[1100];
  1103.  
  1104. strcat(FullList, "Banned by - Date - Reason - IP\n\n");
  1105.  
  1106. for(new i = 0; i < cache_num_rows(); i++)
  1107. {
  1108. cache_get_field_content(i, "BannedBy", By, m_Handle, 60);
  1109. cache_get_field_content(i, "Reason", Reason, m_Handle, 128);
  1110.  
  1111. cache_get_field_content(i, "Date", Date, m_Handle, 90);
  1112. cache_get_field_content(i, "IP", IP, m_Handle, 90);
  1113.  
  1114. format(PackerString, 128, "\t%s - %s - %s - %s\n", By, Date, Reason, IP);
  1115. strcat(FullList, PackerString);
  1116. }
  1117.  
  1118. ShowPlayerDialog(playerid, DIALOG_APANEL, DIALOG_STYLE_MSGBOX, "Administration panel", FullList, "Okay!", "");
  1119. }
  1120. return 1;
  1121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement