Advertisement
AutismAlex

uShop

Dec 19th, 2019
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.40 KB | None | 0 0
  1. usingUconomy = false;
  2. antiLag = true;
  3. updateDelay = 10;
  4.  
  5. weaponsIDArray = array();
  6. clothingIDArray = array();
  7. buildablesIDArray = array();
  8. consumablesIDArray = array();
  9. weaponsDataArray = array();
  10. weaponsDataNameArray = array();
  11. weaponsDataIDArray = array();
  12. clothingDataArray = array();
  13. clothingDataNameArray = array();
  14. clothingDataIDArray = array();
  15. otherDataArray = array();
  16. otherDataNameArray = array();
  17. otherDataIDArray = array();
  18. buildablesDataArray = array();
  19. buildablesDataNameArray = array();
  20. buildablesDataIDArray = array();
  21. consumablesDataArray = array();
  22. consumablesDataNameArray = array();
  23. consumablesDataIDArray = array();
  24. pageData = array();
  25. event onLoad(){
  26. database.execute("CREATE TABLE IF NOT EXISTS uShop(
  27. marketID INT PRIMARY KEY,
  28. name VARCHAR(255) NOT NULL DEFAULT 0,
  29. id INT NOT NULL DEFAULT 0,
  30. durability INT NOT NULL DEFAULT 0,
  31. attachments VARCHAR(255) NOT NULL DEFAULT 0,
  32. type VARCHAR(25) NOT NULL DEFAULT 0,
  33. price INT NOT NULL DEFAULT 0,
  34. seller VARCHAR(17) NOT NULL DEFAULT 0
  35. );");
  36. database.execute("CREATE TABLE IF NOT EXISTS uShopMoney(
  37. marketID INT PRIMARY KEY,
  38. sellerID VARCHAR(17) NOT NULL DEFAULT 0,
  39. amount INT NOT NULL DEFAULT 0
  40. );");
  41. weaponsIDArray = file.read("WeaponsIDList.txt").split(",");
  42. clothingIDArray = file.read("ClothingIDList.txt").split(",");
  43. buildablesIDArray = file.read("BuildablesIDList.txt").split(",");
  44. consumablesIDArray = file.read("ConsumablesIDList.txt").split(",");
  45. }
  46.  
  47. event onInterval(updateDelay){
  48. if(antiLag){
  49. updateBuildablesData();
  50. updateClothingData();
  51. updateConsumablesData();
  52. updateOtherData();
  53. updateWeaponsData();
  54. }
  55. }
  56. function updateWeaponsData(){
  57. weaponsDataArray = array();
  58. weaponsDataNameArray = array();
  59. weaponsDataIDArray = array();
  60. checkType = "Weapon";
  61. marketData = database.execute("SELECT * FROM uShop WHERE type = '" + checkType + "';");
  62. foreach(val in marketData){
  63. weaponsDataArray.add(array(val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]));
  64. weaponsDataNameArray.add(val[1]);
  65. weaponsDataIDArray.add(val[2]);
  66. }
  67. x=0;
  68. while(x != 16){
  69. weaponsDataArray.add(array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty"));
  70. weaponsDataNameArray.add("Empty");
  71. weaponsDataIDArray.add("Empty");
  72. x=x + 1;
  73. }
  74. }
  75. function updateClothingData(){
  76. clothingDataArray = array();
  77. clothingDataNameArray = array();
  78. clothingDataIDArray = array();
  79. checkType = "Clothing";
  80. marketData = database.execute("SELECT * FROM uShop WHERE type = '" + checkType + "';");
  81. foreach(val in marketData){
  82. clothingDataArray.add(array(val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]));
  83. clothingDataNameArray.add(val[1]);
  84. clothingDataIDArray.add(val[2]);
  85. }
  86. x=0;
  87. while(x != 16){
  88. clothingDataArray.add(array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty"));
  89. clothingDataNameArray.add("Empty");
  90. clothingDataIDArray.add("Empty");
  91. x=x + 1;
  92. }
  93. }
  94. function updateBuildablesData(){
  95. buildablesDataArray = array();
  96. buildablesDataNameArray = array();
  97. buildablesDataIDArray = array();
  98. checkType = "Buildable";
  99. marketData = database.execute("SELECT * FROM uShop WHERE type = '" + checkType + "';");
  100. foreach(val in marketData){
  101. buildablesDataArray.add(array(val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]));
  102. buildablesDataNameArray.add(val[1]);
  103. buildablesDataIDArray.add(val[2]);
  104. }
  105. x=0;
  106. while(x != 16){
  107. buildablesDataArray.add(array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty"));
  108. buildablesDataNameArray.add("Empty");
  109. buildablesDataIDArray.add("Empty");
  110. x=x + 1;
  111. }
  112. }
  113. function updateConsumablesData(){
  114. consumablesDataArray = array();
  115. consumablesDataNameArray = array();
  116. consumablesDataIDArray = array();
  117. checkType = "Consumable";
  118. marketData = database.execute("SELECT * FROM uShop WHERE type = '" + checkType + "';");
  119. foreach(val in marketData){
  120. consumablesDataArray.add(array(val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]));
  121. consumablesDataNameArray.add(val[1]);
  122. consumablesDataIDArray.add(val[2]);
  123. }
  124. x=0;
  125. while(x != 16){
  126. consumablesDataArray.add(array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty"));
  127. consumablesDataNameArray.add("Empty");
  128. consumablesDataIDArray.add("Empty");
  129. x=x + 1;
  130. }
  131. }
  132. function updateOtherData(){
  133. otherDataArray = array();
  134. otherDataNameArray = array();
  135. otherDataIDArray = array();
  136. checkType = "Other";
  137. marketData = database.execute("SELECT * FROM uShop WHERE type = '" + checkType + "';");
  138. foreach(val in marketData){
  139. otherDataArray.add(array(val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]));
  140. otherDataNameArray.add(val[1]);
  141. otherDataIDArray.add(val[2]);
  142. }
  143. x=0;
  144. while(x != 16){
  145. otherDataArray.add(array("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty"));
  146. otherDataNameArray.add("Empty");
  147. otherDataIDArray.add("Empty");
  148. x=x + 1;
  149. }
  150. }
  151. function buttonClicked(player, optionNumber){
  152. optionNumberOneLess = optionNumber - 1;
  153. caller = player;
  154. foreach(page in pageData){
  155. if(page[0] == caller.name){
  156. pages = page[1];
  157. pageType = page[2];
  158. if(pageType == "Weapons"){
  159. target = weaponsDataIDArray[toInt(pages * 16 + optionNumberOneLess)];
  160. if(target == "Empty"){
  161. player.message("Item Not Found");
  162. }
  163. else{
  164. effectManager.clearUIbyID(4561, player.id);
  165. effectManager.clearUIbyID(4562, player.id);
  166. effectManager.clearUIbyID(4563, player.id);
  167. effectManager.clearUIbyID(4564, player.id);
  168. checkIDLoop = 1;
  169. foreach(val in weaponsDataArray){
  170. if(checkIDLoop == 1){
  171. if(toNumber(val[2]) == toNumber(target)){
  172. itemName = toString(val[1]);
  173. itemPrice = toNumber(val[6]);
  174. playerBalance = 0;
  175. if(usingUconomy){
  176. playerBalance = player.balance;
  177. }
  178. else{
  179. playerBalance = player.experience;
  180. }
  181. itemDescription = "Durability: " + toString(val[3]) + "%
  182. Attachments:
  183. " + toString(val[4]);
  184. effectManager.sendUI(4560, 4560, player.id, "Back", "Purchase");
  185. page[3] = 1;
  186. page[4] = toNumber(val[0]);
  187. effectManager.sendUI(4565, 4565, player.id, "<color=cyan> Item: " + itemName + "</color>", "<color=cyan> Price: " + itemPrice + "</color>", "<color=cyan> Your balance: " + playerBalance + "</color>", "<color=cyan> " + itemDescription + "</color>");
  188. checkIDLoop = 0;
  189. }
  190. }
  191. }
  192. }
  193. }
  194. else if(pageType == "Consumable"){
  195. target = consumablesDataArray[toInt(pages * 16 + optionNumberOneLess)];
  196. if(target == "Empty"){
  197. player.message("Item Not Found");
  198. }
  199. else{
  200. effectManager.clearUIbyID(4561, player.id);
  201. effectManager.clearUIbyID(4562, player.id);
  202. effectManager.clearUIbyID(4563, player.id);
  203. effectManager.clearUIbyID(4564, player.id);
  204. checkIDLoop = 1;
  205. foreach(val in consumablesDataArray){
  206. if(checkIDLoop == 1){
  207. if(toNumber(val[2]) == toNumber(target)){
  208. itemName = toString(target[1]);
  209. itemPrice = toNumber(target[6]);
  210. playerBalance = 0;
  211. if(usingUconomy){
  212. playerBalance = player.balance;
  213. }
  214. else{
  215. playerBalance = player.experience;
  216. }
  217. itemDescription = "Durability: " + toString(target[3] + "%");
  218. effectManager.sendUI(4560, 4560, player.id, "Back", "Purchase");
  219. page[3] = 1;
  220. page[4] = toNumber(target[0]);
  221. effectManager.sendUI(4565, 4565, player.id, "<color=cyan> Item: " + itemName + "</color>", "<color=cyan> Price: " + itemPrice + "</color>", "<color=cyan> Your balance: " + playerBalance + "</color>", "<color=cyan> " + itemDescription + "</color>");
  222. checkIDLoop = 0;
  223. }
  224. }
  225. }
  226. }
  227. }
  228. else if(pageType == "Clothing"){
  229. target = clothingDataArray[toInt(pages * 16 + optionNumberOneLess)];
  230. if(target == "Empty"){
  231. player.message("Item Not Found");
  232. }
  233. else{
  234. effectManager.clearUIbyID(4561, player.id);
  235. effectManager.clearUIbyID(4562, player.id);
  236. effectManager.clearUIbyID(4563, player.id);
  237. effectManager.clearUIbyID(4564, player.id);
  238. checkIDLoop = 1;
  239. foreach(val in clothingDataArray){
  240. if(checkIDLoop == 1){
  241. if(toNumber(val[2]) == toNumber(target)){
  242. itemName = toString(target[1]);
  243. itemPrice = toNumber(target[6]);
  244. playerBalance = 0;
  245. if(usingUconomy){
  246. playerBalance = player.balance;
  247. }
  248. else{
  249. playerBalance = player.experience;
  250. }
  251. itemDescription = "Durability: " + toString(target[3] + "%");
  252. effectManager.sendUI(4560, 4560, player.id, "Back", "Purchase");
  253. page[3] = 1;
  254. page[4] = toNumber(target[0]);;
  255. effectManager.sendUI(4565, 4565, player.id, "<color=cyan> Item: " + itemName + "</color>", "<color=cyan> Price: " + itemPrice + "</color>", "<color=cyan> Your balance: " + playerBalance + "</color>", "<color=cyan> " + itemDescription + "</color>");
  256. checkIDLoop = 0;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. else if(pageType == "Buildable"){
  263. target = buildablesDataArray[toInt(pages * 16 + optionNumberOneLess)];
  264. if(target == "Empty"){
  265. player.message("Item Not Found");
  266. }
  267. else{
  268. effectManager.clearUIbyID(4561, player.id);
  269. effectManager.clearUIbyID(4562, player.id);
  270. effectManager.clearUIbyID(4563, player.id);
  271. effectManager.clearUIbyID(4564, player.id);
  272. checkIDLoop = 1;
  273. foreach(val in buildablesDataArray){
  274. if(checkIDLoop == 1){
  275. if(toNumber(val[2]) == toNumber(target)){
  276. itemName = toString(target[1]);
  277. itemPrice = toNumber(target[6]);
  278. playerBalance = 0;
  279. if(usingUconomy){
  280. playerBalance = player.balance;
  281. }
  282. else{
  283. playerBalance = player.experience;
  284. }
  285. itemDescription = "Durability: " + toString(target[3] + "%");
  286. effectManager.sendUI(4560, 4560, player.id, "Back", "Purchase");
  287. page[3] = 1;
  288. page[4] = toNumber(target[0]);
  289. effectManager.sendUI(4565, 4565, player.id, "<color=cyan> Item: " + itemName + "</color>", "<color=cyan> Price: " + itemPrice + "</color>", "<color=cyan> Your balance: " + playerBalance + "</color>", "<color=cyan> " + itemDescription + "</color>");
  290. checkIDLoop = 0;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. else if(pageType == "Other"){
  297. target = otherDataArray[toInt(pages * 16 + optionNumberOneLess)];
  298. if(target == "Empty"){
  299. player.message("Item Not Found");
  300. }
  301. else{
  302. effectManager.clearUIbyID(4561, player.id);
  303. effectManager.clearUIbyID(4562, player.id);
  304. effectManager.clearUIbyID(4563, player.id);
  305. effectManager.clearUIbyID(4564, player.id);
  306. checkIDLoop = 1;
  307. foreach(val in otherDataArray){
  308. if(checkIDLoop == 1){
  309. if(toNumber(val[2]) == toNumber(target)){
  310. itemName = toString(target[1]);
  311. itemPrice = toNumber(target[6]);
  312. playerBalance = 0;
  313. if(usingUconomy){
  314. playerBalance = player.balance;
  315. }
  316. else{
  317. playerBalance = player.experience;
  318. }
  319. itemDescription = "Durability: " + toString(target[3] + "%");
  320. effectManager.sendUI(4560, 4560, player.id, "Back", "Purchase");
  321. page[3] = 1;
  322. page[4] = toNumber(target[0]);
  323. effectManager.sendUI(4565, 4565, player.id, "<color=cyan> Item: " + itemName + "</color>", "<color=cyan> Price: " + itemPrice + "</color>", "<color=cyan> Your balance: " + playerBalance + "</color>", "<color=cyan> " + itemDescription + "</color>");
  324. checkIDLoop = 0;
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. command uShop(option, id, price){
  334. permission = "uShop";
  335. execute(){
  336. if(isSet(option)){
  337. if(option == "sell"){
  338. if(isSet(id) and isSet(price)){
  339. if(player.inventory.hasItem(id)){
  340. currentIDCount = 1;
  341. checkItemLoop = 1;
  342. DBcheck = database.execute("SELECT * FROM uShop;");
  343. foreach(val in DBcheck){
  344. if(toNumber(val[0]) >= currentIDCount){
  345. currentIDCount = toNumber(val[0]) + 1;
  346. }
  347. }
  348. inventoryArray = player.inventory.items;
  349. foreach(val in inventoryArray){
  350. if(val.id == id){
  351. if(checkItemLoop == 1){
  352. itemName = val.name;
  353. itemID = id;
  354. itemDurability = 100;
  355. itemAttachments = "None";
  356. itemType = 0;
  357. foreach(idtocheck in weaponsIDArray){
  358. if(toNumber(id) == toNumber(idtocheck)){
  359. itemType = "Weapon";
  360. }
  361. }
  362. foreach(idtocheck in clothingIDArray){
  363. if(toNumber(id) == toNumber(idtocheck)){
  364. itemType = "Clothing";
  365. }
  366. }
  367. foreach(idtocheck in buildablesIDArray){
  368. if(toNumber(id) == toNumber(idtocheck)){
  369. itemType = "Buildable";
  370. }
  371. }
  372. foreach(idtocheck in consumablesIDArray){
  373. if(toNumber(id) == toNumber(idtocheck)){
  374. itemType = "Consumable";
  375. }
  376. }
  377. if(itemType == 0){
  378. itemType = "Other";
  379. }
  380. itemPrice = toNumber(price);
  381. sellerID = player.id;
  382. marketID = currentIDCount;
  383. player.inventory.removeItem(id, 1);
  384. database.execute("INSERT INTO uShop (marketID, name, id, durability, attachments, type, price, seller) VALUES ('" + marketID + "', '" + itemName + "', '" + itemID + "', '" + itemDurability + "', '" + itemAttachments + "', '" + itemType + "', '" + itemPrice + "', '" + sellerID + "');");
  385. checkItemLoop = 0;
  386. }
  387. }
  388. }
  389.  
  390. }
  391. else{
  392. player.message("You dont have the item specified");
  393. }
  394. }
  395. else{
  396. player.message("Correct usage: /uMarket sell ITEMID PRICE");
  397. }
  398. }
  399. else if(option == "open"){
  400. caller = player;
  401. if(player.hasPermission("uShop")){
  402. check = 0;
  403. foreach(page in pageData){
  404. if(page[0] == caller.name){
  405. pageData.remove(page);
  406. break;
  407. }
  408. }
  409. pageData.add(array(caller.name));
  410. foreach(page in pageData){
  411. if(page[0] == caller.name){
  412. page.add(0);
  413. page.add("Weapons");
  414. page.add(0);
  415. page.add("None");
  416. if(antiLag == false){
  417. updateWeaponsData();
  418. }
  419. effectManager.clearUIbyID(4565, player.id);
  420. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  421. effectManager.sendUI(4561, 4561, player.id, weaponsDataNameArray[0], weaponsDataNameArray[1], weaponsDataNameArray[2], weaponsDataNameArray[3]);
  422. effectManager.sendUI(4562, 4562, player.id, weaponsDataNameArray[4], weaponsDataNameArray[5], weaponsDataNameArray[6], weaponsDataNameArray[7]);
  423. effectManager.sendUI(4563, 4563, player.id, weaponsDataNameArray[8], weaponsDataNameArray[9], weaponsDataNameArray[10], weaponsDataNameArray[11]);
  424. effectManager.sendUI(4564, 4564, player.id, weaponsDataNameArray[12], weaponsDataNameArray[13], weaponsDataNameArray[14], weaponsDataNameArray[15]);
  425. }
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. event onEffectButtonClicked(player, key){
  433. caller = player;
  434. if(key == "uShop_Item1"){
  435. buttonClicked(player, 1);
  436. }
  437. else if(key == "uShop_Item2"){
  438. buttonClicked(player, 2);
  439. }
  440. else if(key == "uShop_Item3"){
  441. buttonClicked(player, 3);
  442. }
  443. else if(key == "uShop_Item4"){
  444. buttonClicked(player, 4);
  445. }
  446. else if(key == "uShop_Item5"){
  447. buttonClicked(player, 5);
  448. }
  449. else if(key == "uShop_Item6"){
  450. buttonClicked(player, 6);
  451. }
  452. else if(key == "uShop_Item7"){
  453. buttonClicked(player, 7);
  454. }
  455. else if(key == "uShop_Item8"){
  456. buttonClicked(player, 8);
  457. }
  458. else if(key == "uShop_Item9"){
  459. buttonClicked(player, 9);
  460. }
  461. else if(key == "uShop_Item10"){
  462. buttonClicked(player, 10);
  463. }
  464. else if(key == "uShop_Item11"){
  465. buttonClicked(player, 11);
  466. }
  467. else if(key == "uShop_Item12"){
  468. buttonClicked(player, 12);
  469. }
  470. else if(key == "uShop_Item13"){
  471. buttonClicked(player, 13);
  472. }
  473. else if(key == "uShop_Item14"){
  474. buttonClicked(player, 14);
  475. }
  476. else if(key == "uShop_Item15"){
  477. buttonClicked(player, 15);
  478. }
  479. else if(key == "uShop_Item16"){
  480. buttonClicked(player, 16);
  481. }
  482. else if(key == "uShop_Next_Purchase"){
  483. foreach(page in pageData){
  484. if(page[0] == caller.name and page[3] == 0){
  485. pages = page[1] * 16 + 7;
  486. pageType = page[2];
  487. if(pageType == "Weapons"){
  488. count = math.ceil(weaponsDataArray.count / 16) - 1;
  489. if(page[0] == caller.name and weaponsDataNameArray[toInt(pages)] == "Empty"){
  490. return;
  491. }
  492. else if(page[0] == caller.name and page[1] < count){
  493. page[1] = page[1] + 1;
  494. pages = page[1];
  495. if(antiLag == false){
  496. updateWeaponsData();
  497. }
  498. player1 = pages * 16 + 0;
  499. player2 = pages * 16 + 1;
  500. player3 = pages * 16 + 2;
  501. player4 = pages * 16 + 3;
  502. player5 = pages * 16 + 4;
  503. player6 = pages * 16 + 5;
  504. player7 = pages * 16 + 6;
  505. player8 = pages * 16 + 7;
  506. player9 = pages * 16 + 8;
  507. player10 = pages * 16 + 9;
  508. player11 = pages * 16 + 10;
  509. player12 = pages * 16 + 11;
  510. player13 = pages * 16 + 12;
  511. player14 = pages * 16 + 13;
  512. player15 = pages * 16 + 14;
  513. player16 = pages * 16 + 15;
  514. effectManager.sendUI(4561, 4561, caller.id, weaponsDataNameArray[toInt(player1)], weaponsDataNameArray[toInt(player2)], weaponsDataNameArray[toInt(player3)], weaponsDataNameArray[toInt(player4)]);
  515. effectManager.sendUI(4562, 4562, caller.id, weaponsDataNameArray[toInt(player5)], weaponsDataNameArray[toInt(player6)], weaponsDataNameArray[toInt(player7)], weaponsDataNameArray[toInt(player8)]);
  516. effectManager.sendUI(4563, 4563, caller.id, weaponsDataNameArray[toInt(player9)], weaponsDataNameArray[toInt(player10)], weaponsDataNameArray[toInt(player11)], weaponsDataNameArray[toInt(player12)]);
  517. effectManager.sendUI(4564, 4564, caller.id, weaponsDataNameArray[toInt(player13)], weaponsDataNameArray[toInt(player14)], weaponsDataNameArray[toInt(player15)], weaponsDataNameArray[toInt(player16)]);
  518. return;
  519. }
  520. }
  521. else if(pageType == "Consumable"){
  522. count = math.ceil(consumablesDataArray.count / 16) - 1;
  523. if(page[0] == caller.name and consumablesDataNameArray[toInt(pages)] == "Empty"){
  524. return;
  525. }
  526. else if(page[0] == caller.name and page[1] < count){
  527. page[1] = page[1] + 1;
  528. pages = page[1];
  529. if(antiLag == false){
  530. updateConsumablesData();
  531. }
  532. player1 = pages * 16 + 0;
  533. player2 = pages * 16 + 1;
  534. player3 = pages * 16 + 2;
  535. player4 = pages * 16 + 3;
  536. player5 = pages * 16 + 4;
  537. player6 = pages * 16 + 5;
  538. player7 = pages * 16 + 6;
  539. player8 = pages * 16 + 7;
  540. player9 = pages * 16 + 8;
  541. player10 = pages * 16 + 9;
  542. player11 = pages * 16 + 10;
  543. player12 = pages * 16 + 11;
  544. player13 = pages * 16 + 12;
  545. player14 = pages * 16 + 13;
  546. player15 = pages * 16 + 14;
  547. player16 = pages * 16 + 15;
  548. effectManager.sendUI(4561, 4561, caller.id, consumablesDataNameArray[toInt(player1)], consumablesDataNameArray[toInt(player2)], consumablesDataNameArray[toInt(player3)], consumablesDataNameArray[toInt(player4)]);
  549. effectManager.sendUI(4562, 4562, caller.id, consumablesDataNameArray[toInt(player5)], consumablesDataNameArray[toInt(player6)], consumablesDataNameArray[toInt(player7)], consumablesDataNameArray[toInt(player8)]);
  550. effectManager.sendUI(4563, 4563, caller.id, consumablesDataNameArray[toInt(player9)], consumablesDataNameArray[toInt(player10)], consumablesDataNameArray[toInt(player11)], consumablesDataNameArray[toInt(player12)]);
  551. effectManager.sendUI(4564, 4564, caller.id, consumablesDataNameArray[toInt(player13)], consumablesDataNameArray[toInt(player14)], consumablesDataNameArray[toInt(player15)], consumablesDataNameArray[toInt(player16)]);
  552. return;
  553. }
  554. }
  555. else if(pageType == "Clothing"){
  556. count = math.ceil(clothingDataArray.count / 16) - 1;
  557. if(page[0] == caller.name and clothingDataNameArray[toInt(pages)] == "Empty"){
  558. return;
  559. }
  560. else if(page[0] == caller.name and page[1] < count){
  561. page[1] = page[1] + 1;
  562. pages = page[1];
  563. if(antiLag == false){
  564. updateClothingData();
  565. }
  566. player1 = pages * 16 + 0;
  567. player2 = pages * 16 + 1;
  568. player3 = pages * 16 + 2;
  569. player4 = pages * 16 + 3;
  570. player5 = pages * 16 + 4;
  571. player6 = pages * 16 + 5;
  572. player7 = pages * 16 + 6;
  573. player8 = pages * 16 + 7;
  574. player9 = pages * 16 + 8;
  575. player10 = pages * 16 + 9;
  576. player11 = pages * 16 + 10;
  577. player12 = pages * 16 + 11;
  578. player13 = pages * 16 + 12;
  579. player14 = pages * 16 + 13;
  580. player15 = pages * 16 + 14;
  581. player16 = pages * 16 + 15;
  582. effectManager.sendUI(4561, 4561, caller.id, clothingDataNameArray[toInt(player1)], clothingDataNameArray[toInt(player2)], clothingDataNameArray[toInt(player3)], clothingDataNameArray[toInt(player4)]);
  583. effectManager.sendUI(4562, 4562, caller.id, clothingDataNameArray[toInt(player5)], clothingDataNameArray[toInt(player6)], clothingDataNameArray[toInt(player7)], clothingDataNameArray[toInt(player8)]);
  584. effectManager.sendUI(4563, 4563, caller.id, clothingDataNameArray[toInt(player9)], clothingDataNameArray[toInt(player10)], clothingDataNameArray[toInt(player11)], clothingDataNameArray[toInt(player12)]);
  585. effectManager.sendUI(4564, 4564, caller.id, clothingDataNameArray[toInt(player13)], clothingDataNameArray[toInt(player14)], clothingDataNameArray[toInt(player15)], clothingDataNameArray[toInt(player16)]);
  586. return;
  587. }
  588. }
  589. else if(pageType == "Buildable"){
  590. count = math.ceil(buildablesDataArray.count / 16) - 1;
  591. if(page[0] == caller.name and buildablesDataNameArray[toInt(pages)] == "Empty"){
  592. return;
  593. }
  594. else if(page[0] == caller.name and page[1] < count){
  595. page[1] = page[1] + 1;
  596. pages = page[1];
  597. if(antiLag == false){
  598. updateBuildablesData();
  599. }
  600. player1 = pages * 16 + 0;
  601. player2 = pages * 16 + 1;
  602. player3 = pages * 16 + 2;
  603. player4 = pages * 16 + 3;
  604. player5 = pages * 16 + 4;
  605. player6 = pages * 16 + 5;
  606. player7 = pages * 16 + 6;
  607. player8 = pages * 16 + 7;
  608. player9 = pages * 16 + 8;
  609. player10 = pages * 16 + 9;
  610. player11 = pages * 16 + 10;
  611. player12 = pages * 16 + 11;
  612. player13 = pages * 16 + 12;
  613. player14 = pages * 16 + 13;
  614. player15 = pages * 16 + 14;
  615. player16 = pages * 16 + 15;
  616. effectManager.sendUI(4561, 4561, caller.id, buildablesDataNameArray[toInt(player1)], buildablesDataNameArray[toInt(player2)], buildablesDataNameArray[toInt(player3)], buildablesDataNameArray[toInt(player4)]);
  617. effectManager.sendUI(4562, 4562, caller.id, buildablesDataNameArray[toInt(player5)], buildablesDataNameArray[toInt(player6)], buildablesDataNameArray[toInt(player7)], buildablesDataNameArray[toInt(player8)]);
  618. effectManager.sendUI(4563, 4563, caller.id, buildablesDataNameArray[toInt(player9)], buildablesDataNameArray[toInt(player10)], buildablesDataNameArray[toInt(player11)], buildablesDataNameArray[toInt(player12)]);
  619. effectManager.sendUI(4564, 4564, caller.id, buildablesDataNameArray[toInt(player13)], buildablesDataNameArray[toInt(player14)], buildablesDataNameArray[toInt(player15)], buildablesDataNameArray[toInt(player16)]);
  620. return;
  621. }
  622. }
  623. else if(pageType == "Other"){
  624. count = math.ceil(otherDataArray.count / 16) - 1;
  625. if(page[0] == caller.name and otherDataNameArray[toInt(pages)] == "Empty"){
  626. return;
  627. }
  628. else if(page[0] == caller.name and page[1] < count){
  629. page[1] = page[1] + 1;
  630. pages = page[1];
  631. if(antiLag == false){
  632. updateOtherData();
  633. }
  634. player1 = pages * 16 + 0;
  635. player2 = pages * 16 + 1;
  636. player3 = pages * 16 + 2;
  637. player4 = pages * 16 + 3;
  638. player5 = pages * 16 + 4;
  639. player6 = pages * 16 + 5;
  640. player7 = pages * 16 + 6;
  641. player8 = pages * 16 + 7;
  642. player9 = pages * 16 + 8;
  643. player10 = pages * 16 + 9;
  644. player11 = pages * 16 + 10;
  645. player12 = pages * 16 + 11;
  646. player13 = pages * 16 + 12;
  647. player14 = pages * 16 + 13;
  648. player15 = pages * 16 + 14;
  649. player16 = pages * 16 + 15;
  650. effectManager.sendUI(4561, 4561, caller.id, otherDataNameArray[toInt(player1)], otherDataNameArray[toInt(player2)], otherDataNameArray[toInt(player3)], otherDataNameArray[toInt(player4)]);
  651. effectManager.sendUI(4562, 4562, caller.id, otherDataNameArray[toInt(player5)], otherDataNameArray[toInt(player6)], otherDataNameArray[toInt(player7)], otherDataNameArray[toInt(player8)]);
  652. effectManager.sendUI(4563, 4563, caller.id, otherDataNameArray[toInt(player9)], otherDataNameArray[toInt(player10)], otherDataNameArray[toInt(player11)], otherDataNameArray[toInt(player12)]);
  653. effectManager.sendUI(4564, 4564, caller.id, otherDataNameArray[toInt(player13)], otherDataNameArray[toInt(player14)], otherDataNameArray[toInt(player15)], otherDataNameArray[toInt(player16)]);
  654. return;
  655. }
  656. }
  657. }
  658. else if(page[0] == caller.name and page[3] != 0){
  659. DBcheck = database.execute("SELECT * FROM uShop WHERE marketID = '" + page[4] + "';");
  660. DBcheck=DBcheck[0];
  661. if(usingUconomy){
  662. if(player.balance >= toNumber(DBcheck[6])){
  663. player.decreaseBalance(toNumber(DBcheck[6]));
  664. player.give(toNumber(DBcheck[2]),1);
  665. player.message("Item Bought: " + toString(DBcheck[1]));
  666. currentIDCount = 1;
  667. DBcheck2 = database.execute("SELECT * FROM uShopMoney;");
  668. foreach(val in DBcheck2){
  669. if(toNumber(val[0]) >= currentIDCount){
  670. currentIDCount = toNumber(val[0]) + 1;
  671. }
  672. }
  673. effectManager.clearUIbyID(4560, player.id);
  674. effectManager.clearUIbyID(4565, player.id);
  675. database.execute("DELETE FROM uShop WHERE marketID = '" + DBcheck[0] + "';");
  676. database.execute("INSERT INTO uShopMoney (marketID, sellerID, amount) VALUES ('" + currentIDCount + "', '" + DBcheck[7] + "', '" + DBcheck[6] + "');");
  677. }
  678. else{
  679. player.message("Not Enough Funds!");
  680. }
  681. }
  682. else{
  683. if(player.experience >= toNumber(DBcheck[6])){
  684. player.experience = player.experience - toNumber(DBcheck[6]);
  685. player.give(toNumber(DBcheck[2]),1);
  686. player.message("Item Bought: " + toString(DBcheck[1]));
  687. currentIDCount = 1;
  688. DBcheck2 = database.execute("SELECT * FROM uShopMoney;");
  689. foreach(val in DBcheck2){
  690. if(toNumber(val[0]) >= currentIDCount){
  691. currentIDCount = toNumber(val[0]) + 1;
  692. }
  693. }
  694. effectManager.clearUIbyID(4560, player.id);
  695. effectManager.clearUIbyID(4565, player.id);
  696. database.execute("DELETE FROM uShop WHERE marketID = '" + DBcheck[0] + "';");
  697. database.execute("INSERT INTO uShopMoney (marketID, sellerID, amount) VALUES ('" + currentIDCount + "', '" + DBcheck[7] + "', '" + DBcheck[6] + "');");
  698. }
  699. else{
  700. player.message("Not Enough Funds!");
  701. }
  702. }
  703. }
  704. }
  705. }
  706. else if(key == "uShop_Close"){
  707. foreach(page in pageData){
  708. if(page[0] == player.name){
  709. page[1] = 0;
  710. break;
  711. }
  712. }
  713. effectManager.clearUIbyID(4560, player.id);
  714. effectManager.clearUIbyID(4561, player.id);
  715. effectManager.clearUIbyID(4562, player.id);
  716. effectManager.clearUIbyID(4563, player.id);
  717. effectManager.clearUIbyID(4564, player.id);
  718. effectManager.clearUIbyID(4565, player.id);
  719. }
  720. else if(key == "uShop_Weapons"){
  721. foreach(page in pageData){
  722. if(page[0] == caller.name){
  723. page[1] = 0;
  724. page[2] = "Weapons";
  725. page[3] = 0;
  726. page[4] = "None";
  727. if(antiLag == false){
  728. updateWeaponsData();
  729. }
  730. effectManager.clearUIbyID(4565, player.id);
  731. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  732. effectManager.sendUI(4561, 4561, player.id, weaponsDataNameArray[0], weaponsDataNameArray[1], weaponsDataNameArray[2], weaponsDataNameArray[3]);
  733. effectManager.sendUI(4562, 4562, player.id, weaponsDataNameArray[4], weaponsDataNameArray[5], weaponsDataNameArray[6], weaponsDataNameArray[7]);
  734. effectManager.sendUI(4563, 4563, player.id, weaponsDataNameArray[8], weaponsDataNameArray[9], weaponsDataNameArray[10], weaponsDataNameArray[11]);
  735. effectManager.sendUI(4564, 4564, player.id, weaponsDataNameArray[12], weaponsDataNameArray[13], weaponsDataNameArray[14], weaponsDataNameArray[15]);
  736. }
  737. }
  738. }
  739. else if(key == "uShop_Consumables"){
  740. foreach(page in pageData){
  741. if(page[0] == caller.name){
  742. page[1] = 0;
  743. page[2] = "Consumable";
  744. page[3] = 0;
  745. page[4] = "None";
  746. if(antiLag == false){
  747. updateConsumablesData();
  748. }
  749. effectManager.clearUIbyID(4565, player.id);
  750. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  751. effectManager.sendUI(4561, 4561, player.id, consumablesDataNameArray[0], consumablesDataNameArray[1], consumablesDataNameArray[2], consumablesDataNameArray[3]);
  752. effectManager.sendUI(4562, 4562, player.id, consumablesDataNameArray[4], consumablesDataNameArray[5], consumablesDataNameArray[6], consumablesDataNameArray[7]);
  753. effectManager.sendUI(4563, 4563, player.id, consumablesDataNameArray[8], consumablesDataNameArray[9], consumablesDataNameArray[10], consumablesDataNameArray[11]);
  754. effectManager.sendUI(4564, 4564, player.id, consumablesDataNameArray[12], consumablesDataNameArray[13], consumablesDataNameArray[14], consumablesDataNameArray[15]);
  755. }
  756. }
  757. }
  758. else if(key == "uShop_Clothing"){
  759. foreach(page in pageData){
  760. if(page[0] == caller.name){
  761. page[1] = 0;
  762. page[2] = "Clothing";
  763. page[3] = 0;
  764. page[4] = "None";
  765. if(antiLag == false){
  766. updateClothingData();
  767. }
  768. effectManager.clearUIbyID(4565, player.id);
  769. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  770. effectManager.sendUI(4561, 4561, player.id, clothingDataNameArray[0], clothingDataNameArray[1], clothingDataNameArray[2], clothingDataNameArray[3]);
  771. effectManager.sendUI(4562, 4562, player.id, clothingDataNameArray[4], clothingDataNameArray[5], clothingDataNameArray[6], clothingDataNameArray[7]);
  772. effectManager.sendUI(4563, 4563, player.id, clothingDataNameArray[8], clothingDataNameArray[9], clothingDataNameArray[10], clothingDataNameArray[11]);
  773. effectManager.sendUI(4564, 4564, player.id, clothingDataNameArray[12], clothingDataNameArray[13], clothingDataNameArray[14], clothingDataNameArray[15]);
  774. }
  775. }
  776. }
  777. else if(key == "uShop_Buildables"){
  778. foreach(page in pageData){
  779. if(page[0] == caller.name){
  780. page[1] = 0;
  781. page[2] = "Buildable";
  782. page[3] = 0;
  783. page[4] = "None";
  784. if(antiLag == false){
  785. updateBuildablesData();
  786. }
  787. effectManager.clearUIbyID(4565, player.id);
  788. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  789. effectManager.sendUI(4561, 4561, player.id, buildablesDataNameArray[0], buildablesDataNameArray[1], buildablesDataNameArray[2], buildablesDataNameArray[3]);
  790. effectManager.sendUI(4562, 4562, player.id, buildablesDataNameArray[4], buildablesDataNameArray[5], buildablesDataNameArray[6], buildablesDataNameArray[7]);
  791. effectManager.sendUI(4563, 4563, player.id, buildablesDataNameArray[8], buildablesDataNameArray[9], buildablesDataNameArray[10], buildablesDataNameArray[11]);
  792. effectManager.sendUI(4564, 4564, player.id, buildablesDataNameArray[12], buildablesDataNameArray[13], buildablesDataNameArray[14], buildablesDataNameArray[15]);
  793. }
  794. }
  795. }
  796. else if(key == "uShop_Other"){
  797. foreach(page in pageData){
  798. if(page[0] == caller.name){
  799. page[1] = 0;
  800. page[2] = "Other";
  801. page[3] = 0;
  802. page[4] = "None";
  803. if(antiLag == false){
  804. updateOtherData();
  805. }
  806. effectManager.clearUIbyID(4565, player.id);
  807. effectManager.sendUI(4560, 4560, player.id, "<--", "-->");
  808. effectManager.sendUI(4561, 4561, player.id, otherDataNameArray[0], otherDataNameArray[1], otherDataNameArray[2], otherDataNameArray[3]);
  809. effectManager.sendUI(4562, 4562, player.id, otherDataNameArray[4], otherDataNameArray[5], otherDataNameArray[6], otherDataNameArray[7]);
  810. effectManager.sendUI(4563, 4563, player.id, otherDataNameArray[8], otherDataNameArray[9], otherDataNameArray[10], otherDataNameArray[11]);
  811. effectManager.sendUI(4564, 4564, player.id, otherDataNameArray[12], otherDataNameArray[13], otherDataNameArray[14], otherDataNameArray[15]);
  812. }
  813. }
  814. }
  815. else if(key == "uShop_Previous_Back"){
  816. foreach(page in pageData){
  817. if(page[0] == caller.name and page[3] == 0){
  818. pages = page[1] * 16 + 7;
  819. pageType = page[2];
  820. if(pageType == "Weapons"){
  821. else if(page[0] == caller.name and page[1] > 0){
  822. page[1] = page[1] - 1;
  823. pages = page[1];
  824. if(antiLag == false){
  825. updateWeaponsData();
  826. }
  827. player1 = pages * 16 + 0;
  828. player2 = pages * 16 + 1;
  829. player3 = pages * 16 + 2;
  830. player4 = pages * 16 + 3;
  831. player5 = pages * 16 + 4;
  832. player6 = pages * 16 + 5;
  833. player7 = pages * 16 + 6;
  834. player8 = pages * 16 + 7;
  835. player9 = pages * 16 + 8;
  836. player10 = pages * 16 + 9;
  837. player11 = pages * 16 + 10;
  838. player12 = pages * 16 + 11;
  839. player13 = pages * 16 + 12;
  840. player14 = pages * 16 + 13;
  841. player15 = pages * 16 + 14;
  842. player16 = pages * 16 + 15;
  843. effectManager.sendUI(4561, 4561, caller.id, weaponsDataNameArray[toInt(player1)], weaponsDataNameArray[toInt(player2)], weaponsDataNameArray[toInt(player3)], weaponsDataNameArray[toInt(player4)]);
  844. effectManager.sendUI(4562, 4562, caller.id, weaponsDataNameArray[toInt(player5)], weaponsDataNameArray[toInt(player6)], weaponsDataNameArray[toInt(player7)], weaponsDataNameArray[toInt(player8)]);
  845. effectManager.sendUI(4563, 4563, caller.id, weaponsDataNameArray[toInt(player9)], weaponsDataNameArray[toInt(player10)], weaponsDataNameArray[toInt(player11)], weaponsDataNameArray[toInt(player12)]);
  846. effectManager.sendUI(4564, 4564, caller.id, weaponsDataNameArray[toInt(player13)], weaponsDataNameArray[toInt(player14)], weaponsDataNameArray[toInt(player15)], weaponsDataNameArray[toInt(player16)]);
  847. return;
  848. }
  849. }
  850. else if(pageType == "Consumable"){
  851. else if(page[0] == caller.name and page[1] > 0){
  852. page[1] = page[1] - 1;
  853. pages = page[1];
  854. if(antiLag == false){
  855. updateConsumablesData();
  856. }
  857. player1 = pages * 16 + 0;
  858. player2 = pages * 16 + 1;
  859. player3 = pages * 16 + 2;
  860. player4 = pages * 16 + 3;
  861. player5 = pages * 16 + 4;
  862. player6 = pages * 16 + 5;
  863. player7 = pages * 16 + 6;
  864. player8 = pages * 16 + 7;
  865. player9 = pages * 16 + 8;
  866. player10 = pages * 16 + 9;
  867. player11 = pages * 16 + 10;
  868. player12 = pages * 16 + 11;
  869. player13 = pages * 16 + 12;
  870. player14 = pages * 16 + 13;
  871. player15 = pages * 16 + 14;
  872. player16 = pages * 16 + 15;
  873. effectManager.sendUI(4561, 4561, caller.id, consumablesDataNameArray[toInt(player1)], consumablesDataNameArray[toInt(player2)], consumablesDataNameArray[toInt(player3)], consumablesDataNameArray[toInt(player4)]);
  874. effectManager.sendUI(4562, 4562, caller.id, consumablesDataNameArray[toInt(player5)], consumablesDataNameArray[toInt(player6)], consumablesDataNameArray[toInt(player7)], consumablesDataNameArray[toInt(player8)]);
  875. effectManager.sendUI(4563, 4563, caller.id, consumablesDataNameArray[toInt(player9)], consumablesDataNameArray[toInt(player10)], consumablesDataNameArray[toInt(player11)], consumablesDataNameArray[toInt(player12)]);
  876. effectManager.sendUI(4564, 4564, caller.id, consumablesDataNameArray[toInt(player13)], consumablesDataNameArray[toInt(player14)], consumablesDataNameArray[toInt(player15)], consumablesDataNameArray[toInt(player16)]);
  877. return;
  878. }
  879. }
  880. else if(pageType == "Clothing"){
  881. else if(page[0] == caller.name and page[1] > 0){
  882. page[1] = page[1] - 1;
  883. pages = page[1];
  884. if(antiLag == false){
  885. updateClothingData();
  886. }
  887. player1 = pages * 16 + 0;
  888. player2 = pages * 16 + 1;
  889. player3 = pages * 16 + 2;
  890. player4 = pages * 16 + 3;
  891. player5 = pages * 16 + 4;
  892. player6 = pages * 16 + 5;
  893. player7 = pages * 16 + 6;
  894. player8 = pages * 16 + 7;
  895. player9 = pages * 16 + 8;
  896. player10 = pages * 16 + 9;
  897. player11 = pages * 16 + 10;
  898. player12 = pages * 16 + 11;
  899. player13 = pages * 16 + 12;
  900. player14 = pages * 16 + 13;
  901. player15 = pages * 16 + 14;
  902. player16 = pages * 16 + 15;
  903. effectManager.sendUI(4561, 4561, caller.id, clothingDataNameArray[toInt(player1)], clothingDataNameArray[toInt(player2)], clothingDataNameArray[toInt(player3)], clothingDataNameArray[toInt(player4)]);
  904. effectManager.sendUI(4562, 4562, caller.id, clothingDataNameArray[toInt(player5)], clothingDataNameArray[toInt(player6)], clothingDataNameArray[toInt(player7)], clothingDataNameArray[toInt(player8)]);
  905. effectManager.sendUI(4563, 4563, caller.id, clothingDataNameArray[toInt(player9)], clothingDataNameArray[toInt(player10)], clothingDataNameArray[toInt(player11)], clothingDataNameArray[toInt(player12)]);
  906. effectManager.sendUI(4564, 4564, caller.id, clothingDataNameArray[toInt(player13)], clothingDataNameArray[toInt(player14)], clothingDataNameArray[toInt(player15)], clothingDataNameArray[toInt(player16)]);
  907. return;
  908. }
  909. }
  910. else if(pageType == "Buildable"){
  911. else if(page[0] == caller.name and page[1] > 0){
  912. page[1] = page[1] - 1;
  913. pages = page[1];
  914. if(antiLag == false){
  915. updateBuildablesData();
  916. }
  917. player1 = pages * 16 + 0;
  918. player2 = pages * 16 + 1;
  919. player3 = pages * 16 + 2;
  920. player4 = pages * 16 + 3;
  921. player5 = pages * 16 + 4;
  922. player6 = pages * 16 + 5;
  923. player7 = pages * 16 + 6;
  924. player8 = pages * 16 + 7;
  925. player9 = pages * 16 + 8;
  926. player10 = pages * 16 + 9;
  927. player11 = pages * 16 + 10;
  928. player12 = pages * 16 + 11;
  929. player13 = pages * 16 + 12;
  930. player14 = pages * 16 + 13;
  931. player15 = pages * 16 + 14;
  932. player16 = pages * 16 + 15;
  933. effectManager.sendUI(4561, 4561, caller.id, buildablesDataNameArray[toInt(player1)], buildablesDataNameArray[toInt(player2)], buildablesDataNameArray[toInt(player3)], buildablesDataNameArray[toInt(player4)]);
  934. effectManager.sendUI(4562, 4562, caller.id, buildablesDataNameArray[toInt(player5)], buildablesDataNameArray[toInt(player6)], buildablesDataNameArray[toInt(player7)], buildablesDataNameArray[toInt(player8)]);
  935. effectManager.sendUI(4563, 4563, caller.id, buildablesDataNameArray[toInt(player9)], buildablesDataNameArray[toInt(player10)], buildablesDataNameArray[toInt(player11)], buildablesDataNameArray[toInt(player12)]);
  936. effectManager.sendUI(4564, 4564, caller.id, buildablesDataNameArray[toInt(player13)], buildablesDataNameArray[toInt(player14)], buildablesDataNameArray[toInt(player15)], buildablesDataNameArray[toInt(player16)]);
  937. return;
  938. }
  939. }
  940. else if(pageType == "Other"){
  941. else if(page[0] == caller.name and page[1] > 0){
  942. page[1] = page[1] - 1;
  943. pages = page[1];
  944. if(antiLag == false){
  945. updateOtherData();
  946. }
  947. player1 = pages * 16 + 0;
  948. player2 = pages * 16 + 1;
  949. player3 = pages * 16 + 2;
  950. player4 = pages * 16 + 3;
  951. player5 = pages * 16 + 4;
  952. player6 = pages * 16 + 5;
  953. player7 = pages * 16 + 6;
  954. player8 = pages * 16 + 7;
  955. player9 = pages * 16 + 8;
  956. player10 = pages * 16 + 9;
  957. player11 = pages * 16 + 10;
  958. player12 = pages * 16 + 11;
  959. player13 = pages * 16 + 12;
  960. player14 = pages * 16 + 13;
  961. player15 = pages * 16 + 14;
  962. player16 = pages * 16 + 15;
  963. effectManager.sendUI(4561, 4561, caller.id, otherDataNameArray[toInt(player1)], otherDataNameArray[toInt(player2)], otherDataNameArray[toInt(player3)], otherDataNameArray[toInt(player4)]);
  964. effectManager.sendUI(4562, 4562, caller.id, otherDataNameArray[toInt(player5)], otherDataNameArray[toInt(player6)], otherDataNameArray[toInt(player7)], otherDataNameArray[toInt(player8)]);
  965. effectManager.sendUI(4563, 4563, caller.id, otherDataNameArray[toInt(player9)], otherDataNameArray[toInt(player10)], otherDataNameArray[toInt(player11)], otherDataNameArray[toInt(player12)]);
  966. effectManager.sendUI(4564, 4564, caller.id, otherDataNameArray[toInt(player13)], otherDataNameArray[toInt(player14)], otherDataNameArray[toInt(player15)], otherDataNameArray[toInt(player16)]);
  967. return;
  968. }
  969. }
  970. }
  971. else{
  972. page[3] = 0;
  973. effectManager.clearUIbyID(4565, caller.id);
  974. effectManager.sendUI(4560, 4560, caller.id, "<--", "-->");
  975. pageType = page[2];
  976. if(pageType == "Weapons"){
  977. else if(page[0] == caller.name){
  978. pages = page[1];
  979. if(antiLag == false){
  980. updateWeaponsData();
  981. }
  982. player1 = pages * 16 + 0;
  983. player2 = pages * 16 + 1;
  984. player3 = pages * 16 + 2;
  985. player4 = pages * 16 + 3;
  986. player5 = pages * 16 + 4;
  987. player6 = pages * 16 + 5;
  988. player7 = pages * 16 + 6;
  989. player8 = pages * 16 + 7;
  990. player9 = pages * 16 + 8;
  991. player10 = pages * 16 + 9;
  992. player11 = pages * 16 + 10;
  993. player12 = pages * 16 + 11;
  994. player13 = pages * 16 + 12;
  995. player14 = pages * 16 + 13;
  996. player15 = pages * 16 + 14;
  997. player16 = pages * 16 + 15;
  998. effectManager.sendUI(4561, 4561, caller.id, weaponsDataNameArray[toInt(player1)], weaponsDataNameArray[toInt(player2)], weaponsDataNameArray[toInt(player3)], weaponsDataNameArray[toInt(player4)]);
  999. effectManager.sendUI(4562, 4562, caller.id, weaponsDataNameArray[toInt(player5)], weaponsDataNameArray[toInt(player6)], weaponsDataNameArray[toInt(player7)], weaponsDataNameArray[toInt(player8)]);
  1000. effectManager.sendUI(4563, 4563, caller.id, weaponsDataNameArray[toInt(player9)], weaponsDataNameArray[toInt(player10)], weaponsDataNameArray[toInt(player11)], weaponsDataNameArray[toInt(player12)]);
  1001. effectManager.sendUI(4564, 4564, caller.id, weaponsDataNameArray[toInt(player13)], weaponsDataNameArray[toInt(player14)], weaponsDataNameArray[toInt(player15)], weaponsDataNameArray[toInt(player16)]);
  1002. return;
  1003. }
  1004. }
  1005. else if(pageType == "Consumable"){
  1006. else if(page[0] == caller.name){
  1007. pages = page[1];
  1008. if(antiLag == false){
  1009. updateConsumablesData();
  1010. }
  1011. player1 = pages * 16 + 0;
  1012. player2 = pages * 16 + 1;
  1013. player3 = pages * 16 + 2;
  1014. player4 = pages * 16 + 3;
  1015. player5 = pages * 16 + 4;
  1016. player6 = pages * 16 + 5;
  1017. player7 = pages * 16 + 6;
  1018. player8 = pages * 16 + 7;
  1019. player9 = pages * 16 + 8;
  1020. player10 = pages * 16 + 9;
  1021. player11 = pages * 16 + 10;
  1022. player12 = pages * 16 + 11;
  1023. player13 = pages * 16 + 12;
  1024. player14 = pages * 16 + 13;
  1025. player15 = pages * 16 + 14;
  1026. player16 = pages * 16 + 15;
  1027. effectManager.sendUI(4561, 4561, caller.id, consumablesDataNameArray[toInt(player1)], consumablesDataNameArray[toInt(player2)], consumablesDataNameArray[toInt(player3)], consumablesDataNameArray[toInt(player4)]);
  1028. effectManager.sendUI(4562, 4562, caller.id, consumablesDataNameArray[toInt(player5)], consumablesDataNameArray[toInt(player6)], consumablesDataNameArray[toInt(player7)], consumablesDataNameArray[toInt(player8)]);
  1029. effectManager.sendUI(4563, 4563, caller.id, consumablesDataNameArray[toInt(player9)], consumablesDataNameArray[toInt(player10)], consumablesDataNameArray[toInt(player11)], consumablesDataNameArray[toInt(player12)]);
  1030. effectManager.sendUI(4564, 4564, caller.id, consumablesDataNameArray[toInt(player13)], consumablesDataNameArray[toInt(player14)], consumablesDataNameArray[toInt(player15)], consumablesDataNameArray[toInt(player16)]);
  1031. return;
  1032. }
  1033. }
  1034. else if(pageType == "Clothing"){
  1035. else if(page[0] == caller.name){
  1036. pages = page[1];
  1037. if(antiLag == false){
  1038. updateClothingData();
  1039. }
  1040. player1 = pages * 16 + 0;
  1041. player2 = pages * 16 + 1;
  1042. player3 = pages * 16 + 2;
  1043. player4 = pages * 16 + 3;
  1044. player5 = pages * 16 + 4;
  1045. player6 = pages * 16 + 5;
  1046. player7 = pages * 16 + 6;
  1047. player8 = pages * 16 + 7;
  1048. player9 = pages * 16 + 8;
  1049. player10 = pages * 16 + 9;
  1050. player11 = pages * 16 + 10;
  1051. player12 = pages * 16 + 11;
  1052. player13 = pages * 16 + 12;
  1053. player14 = pages * 16 + 13;
  1054. player15 = pages * 16 + 14;
  1055. player16 = pages * 16 + 15;
  1056. effectManager.sendUI(4561, 4561, caller.id, clothingDataNameArray[toInt(player1)], clothingDataNameArray[toInt(player2)], clothingDataNameArray[toInt(player3)], clothingDataNameArray[toInt(player4)]);
  1057. effectManager.sendUI(4562, 4562, caller.id, clothingDataNameArray[toInt(player5)], clothingDataNameArray[toInt(player6)], clothingDataNameArray[toInt(player7)], clothingDataNameArray[toInt(player8)]);
  1058. effectManager.sendUI(4563, 4563, caller.id, clothingDataNameArray[toInt(player9)], clothingDataNameArray[toInt(player10)], clothingDataNameArray[toInt(player11)], clothingDataNameArray[toInt(player12)]);
  1059. effectManager.sendUI(4564, 4564, caller.id, clothingDataNameArray[toInt(player13)], clothingDataNameArray[toInt(player14)], clothingDataNameArray[toInt(player15)], clothingDataNameArray[toInt(player16)]);
  1060. return;
  1061. }
  1062. }
  1063. else if(pageType == "Buildable"){
  1064. else if(page[0] == caller.name){
  1065. pages = page[1];
  1066. if(antiLag == false){
  1067. updateBuildablesData();
  1068. }
  1069. player1 = pages * 16 + 0;
  1070. player2 = pages * 16 + 1;
  1071. player3 = pages * 16 + 2;
  1072. player4 = pages * 16 + 3;
  1073. player5 = pages * 16 + 4;
  1074. player6 = pages * 16 + 5;
  1075. player7 = pages * 16 + 6;
  1076. player8 = pages * 16 + 7;
  1077. player9 = pages * 16 + 8;
  1078. player10 = pages * 16 + 9;
  1079. player11 = pages * 16 + 10;
  1080. player12 = pages * 16 + 11;
  1081. player13 = pages * 16 + 12;
  1082. player14 = pages * 16 + 13;
  1083. player15 = pages * 16 + 14;
  1084. player16 = pages * 16 + 15;
  1085. effectManager.sendUI(4561, 4561, caller.id, buildablesDataNameArray[toInt(player1)], buildablesDataNameArray[toInt(player2)], buildablesDataNameArray[toInt(player3)], buildablesDataNameArray[toInt(player4)]);
  1086. effectManager.sendUI(4562, 4562, caller.id, buildablesDataNameArray[toInt(player5)], buildablesDataNameArray[toInt(player6)], buildablesDataNameArray[toInt(player7)], buildablesDataNameArray[toInt(player8)]);
  1087. effectManager.sendUI(4563, 4563, caller.id, buildablesDataNameArray[toInt(player9)], buildablesDataNameArray[toInt(player10)], buildablesDataNameArray[toInt(player11)], buildablesDataNameArray[toInt(player12)]);
  1088. effectManager.sendUI(4564, 4564, caller.id, buildablesDataNameArray[toInt(player13)], buildablesDataNameArray[toInt(player14)], buildablesDataNameArray[toInt(player15)], buildablesDataNameArray[toInt(player16)]);
  1089. return;
  1090. }
  1091. }
  1092. else if(pageType == "Other"){
  1093. else if(page[0] == caller.name){
  1094. pages = page[1];
  1095. if(antiLag == false){
  1096. updateOtherData();
  1097. }
  1098. player1 = pages * 16 + 0;
  1099. player2 = pages * 16 + 1;
  1100. player3 = pages * 16 + 2;
  1101. player4 = pages * 16 + 3;
  1102. player5 = pages * 16 + 4;
  1103. player6 = pages * 16 + 5;
  1104. player7 = pages * 16 + 6;
  1105. player8 = pages * 16 + 7;
  1106. player9 = pages * 16 + 8;
  1107. player10 = pages * 16 + 9;
  1108. player11 = pages * 16 + 10;
  1109. player12 = pages * 16 + 11;
  1110. player13 = pages * 16 + 12;
  1111. player14 = pages * 16 + 13;
  1112. player15 = pages * 16 + 14;
  1113. player16 = pages * 16 + 15;
  1114. effectManager.sendUI(4561, 4561, caller.id, otherDataNameArray[toInt(player1)], otherDataNameArray[toInt(player2)], otherDataNameArray[toInt(player3)], otherDataNameArray[toInt(player4)]);
  1115. effectManager.sendUI(4562, 4562, caller.id, otherDataNameArray[toInt(player5)], otherDataNameArray[toInt(player6)], otherDataNameArray[toInt(player7)], otherDataNameArray[toInt(player8)]);
  1116. effectManager.sendUI(4563, 4563, caller.id, otherDataNameArray[toInt(player9)], otherDataNameArray[toInt(player10)], otherDataNameArray[toInt(player11)], otherDataNameArray[toInt(player12)]);
  1117. effectManager.sendUI(4564, 4564, caller.id, otherDataNameArray[toInt(player13)], otherDataNameArray[toInt(player14)], otherDataNameArray[toInt(player15)], otherDataNameArray[toInt(player16)]);
  1118. return;
  1119. }
  1120. }
  1121. }
  1122. }
  1123. }
  1124. }
  1125. event onPlayerJoined(player){
  1126. DBcheck = database.execute("SELECT * FROM uShopMoney WHERE sellerID = '" + player.id + "';");
  1127. earnedOffline = 0;
  1128. foreach(val in DBcheck){
  1129. earnedOffline = earnedOffline + toNumber(val[2]);
  1130. database.execute("DELETE FROM uShopMoney WHERE marketID = '" + val[0] + "';");
  1131. }
  1132. player.message("You earned " + earnedOffline + " While Offline!");
  1133. if(usingUconomy){
  1134. player.increaseBalance(earnedOffline);
  1135. }
  1136. else{
  1137. player.experience = player.experience + earnedOffline;
  1138. }
  1139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement