Advertisement
Guest User

Untitled

a guest
May 25th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.72 KB | None | 0 0
  1. if (Main.IsInRangeOfPoint(player.Position, new Vector3(2140.131, 4807.775, 41.13992), 2.0f))
  2. {
  3. List<dynamic> menu_item_list = new List<dynamic>();
  4. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Sardinen", Description = "", RightLabel = "" });
  5. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Welse", Description = "", RightLabel = "" });
  6. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Rotaugen", Description = "", RightLabel = "" });
  7. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Aale", Description = "", RightLabel = "" });
  8. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Barsche", Description = "", RightLabel = "" });
  9. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Thunfische", Description = "", RightLabel = "" });
  10. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Seitlinge", Description = "", RightLabel = "" });
  11. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Heringe", Description = "", RightLabel = "" });
  12. menu_item_list.Add(new { Type = 1, Name = "Verkaufe grüner Aale", Description = "", RightLabel = "" });
  13. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Tintenfische", Description = "", RightLabel = "" });
  14. menu_item_list.Add(new { Type = 1, Name = "Verkaufe Kugelfische", Description = "", RightLabel = "" });
  15. menu_item_list.Add(new { Type = 1, Name = "Verkaufe weißer Haie", Description = "", RightLabel = "" });
  16.  
  17. InteractMenu.CreateMenu(player, "SELL_FISH", "Fischmarkt", "~b~Fisch Ankauf", true, NAPI.Util.ToJson(menu_item_list), false);
  18. }
  19. }
  20.  
  21. public static void SelectMenuResponse(Client player, String callbackId, int selectedIndex, String objectName, String valueList)
  22. {
  23. if (callbackId == "SELL_FISH")
  24. {
  25. if (selectedIndex == 0)
  26. {
  27. if (Inventory.GetPlayerItemFromInventory(player, 21) > 0)
  28. {
  29. InteractMenu.User_Input(player, "input_sell_sardine", "Verkaufen Sie Sardinene", Inventory.GetPlayerItemFromInventory(player, 21).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 21) + "", "number");
  30. }
  31. }
  32. else if (selectedIndex == 1)
  33. {
  34. if (Inventory.GetPlayerItemFromInventory(player, 22) > 0)
  35. {
  36. InteractMenu.User_Input(player, "input_sell_wels", "Verkaufen Sie WElse", Inventory.GetPlayerItemFromInventory(player, 22).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 22) + "", "number");
  37. }
  38. }
  39. else if (selectedIndex == 2)
  40. {
  41. if (Inventory.GetPlayerItemFromInventory(player, 23) > 0)
  42. {
  43. InteractMenu.User_Input(player, "input_sell_rotauge", "Verkaufen Sie Rotaugen", Inventory.GetPlayerItemFromInventory(player, 23).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 23) + "", "number");
  44. }
  45. }
  46. else if (selectedIndex == 3)
  47. {
  48. if (Inventory.GetPlayerItemFromInventory(player, 24) > 0)
  49. {
  50. InteractMenu.User_Input(player, "input_sell_aal", "Verkaufen Sie Aale", Inventory.GetPlayerItemFromInventory(player, 24).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 24) + "", "number");
  51. }
  52. }
  53. else if (selectedIndex == 4)
  54. {
  55. if (Inventory.GetPlayerItemFromInventory(player, 25) > 0)
  56. {
  57. InteractMenu.User_Input(player, "input_sell_barsch", "Verkaufen Sie Barsche", Inventory.GetPlayerItemFromInventory(player, 25).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 25) + "", "number");
  58. }
  59. }
  60. else if (selectedIndex == 5)
  61. {
  62. if (Inventory.GetPlayerItemFromInventory(player, 26) > 0)
  63. {
  64. InteractMenu.User_Input(player, "input_sell_thunfisch", "Verkaufen Sie Thunfische", Inventory.GetPlayerItemFromInventory(player, 26).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 26) + "", "number");
  65. }
  66. }
  67. else if (selectedIndex == 6)
  68. {
  69. if (Inventory.GetPlayerItemFromInventory(player, 27) > 0)
  70. {
  71. InteractMenu.User_Input(player, "input_sell_seitling", "Verkaufen Sie Seitlinge", Inventory.GetPlayerItemFromInventory(player, 27).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 27) + "", "number");
  72. }
  73. }
  74. else if (selectedIndex == 7)
  75. {
  76. if (Inventory.GetPlayerItemFromInventory(player, 28) > 0)
  77. {
  78. InteractMenu.User_Input(player, "input_sell_hering", "Verkaufen Sie Heringe", Inventory.GetPlayerItemFromInventory(player, 28).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 28) + "", "number");
  79. }
  80. }
  81. else if (selectedIndex == 8)
  82. {
  83. if (Inventory.GetPlayerItemFromInventory(player, 29) > 0)
  84. {
  85. InteractMenu.User_Input(player, "input_sell_grüneraal", "Verkaufen Sie grüne Aale", Inventory.GetPlayerItemFromInventory(player, 29).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 29) + "", "number");
  86. }
  87. }
  88. else if (selectedIndex == 9)
  89. {
  90. if (Inventory.GetPlayerItemFromInventory(player, 30) > 0)
  91. {
  92. InteractMenu.User_Input(player, "input_sell_tintenfisch", "Verkaufen Sie Tintenfisch", Inventory.GetPlayerItemFromInventory(player, 30).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 30) + "", "number");
  93. }
  94. }
  95. else if (selectedIndex == 10)
  96. {
  97. if (Inventory.GetPlayerItemFromInventory(player, 31) > 0)
  98. {
  99. InteractMenu.User_Input(player, "input_sell_kugelfisch", "Verkaufen Sie Kugelfisch", Inventory.GetPlayerItemFromInventory(player, 31).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 31) + "", "number");
  100. }
  101. }
  102. else if (selectedIndex == 11)
  103. {
  104. if (Inventory.GetPlayerItemFromInventory(player, 32) > 0)
  105. {
  106. InteractMenu.User_Input(player, "input_sell_weißerhai", "Verkaufen Sie weißer Hai", Inventory.GetPlayerItemFromInventory(player, 32).ToString(), "Sie haben derzeit " + Inventory.GetPlayerItemFromInventory(player, 32) + "", "number");
  107. }
  108. }
  109. }
  110. }
  111. public static void OnInputResponse(Client player, String response, String inputtext)
  112. {
  113. if (response == "input_sell_sardine")
  114. {
  115. if (Inventory.GetPlayerItemFromInventory(player, 21) > 0)
  116. {
  117.  
  118. if (!Main.IsNumeric(inputtext))
  119. {
  120. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch.Bitte geben Sie einen gültigen Wert ein.");
  121. return;
  122. }
  123.  
  124. int valor = Convert.ToInt32(inputtext);
  125.  
  126. if (valor < 1)
  127. {
  128. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  129. return;
  130. }
  131.  
  132. if (Inventory.GetPlayerItemFromInventory(player, 21) < valor)
  133. {
  134. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Sardinen , Sie haben nur" + Inventory.GetPlayerItemFromInventory(player, 21) + ".");
  135. return;
  136. }
  137.  
  138. int price = valor * 85;
  139.  
  140. Main.GivePlayerMoney(player, price);
  141. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Sardinen für $" + price.ToString("N0") + "");
  142. Inventory.RemoveItem(player, "Sardine", valor);
  143. }
  144. }
  145. else if (response == "input_sell_wels")
  146. {
  147. if (Inventory.GetPlayerItemFromInventory(player, 22) > 0)
  148. {
  149.  
  150. if (!Main.IsNumeric(inputtext))
  151. {
  152. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  153. return;
  154. }
  155.  
  156. int valor = Convert.ToInt32(inputtext);
  157.  
  158. if (valor < 1)
  159. {
  160. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  161. return;
  162. }
  163.  
  164. if (Inventory.GetPlayerItemFromInventory(player, 22) < valor)
  165. {
  166. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Welse und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 22) + ".");
  167. return;
  168. }
  169.  
  170. int price = valor * 107;
  171.  
  172. Main.GivePlayerMoney(player, price);
  173. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Welse für $" + price.ToString("N0") + "");
  174. Inventory.RemoveItem(player, "Wels", valor);
  175. }
  176. }
  177. else if (response == "input_sell_rotauge")
  178. {
  179. if (Inventory.GetPlayerItemFromInventory(player, 23) > 0)
  180. {
  181.  
  182. if (!Main.IsNumeric(inputtext))
  183. {
  184. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  185. return;
  186. }
  187.  
  188. int valor = Convert.ToInt32(inputtext);
  189.  
  190. if (valor < 1)
  191. {
  192. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  193. return;
  194. }
  195.  
  196. if (Inventory.GetPlayerItemFromInventory(player, 23) < valor)
  197. {
  198. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Rotaugen und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 23) + ".");
  199. return;
  200. }
  201.  
  202. int price = valor * 131;
  203.  
  204. Main.GivePlayerMoney(player, price);
  205. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Rotaugen für $" + price.ToString("N0") + "");
  206. Inventory.RemoveItem(player, "Rotaugen", valor);
  207. }
  208. }
  209. else if (response == "input_sell_aal")
  210. {
  211. if (Inventory.GetPlayerItemFromInventory(player, 24) > 0)
  212. {
  213.  
  214. if (!Main.IsNumeric(inputtext))
  215. {
  216. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  217. return;
  218. }
  219.  
  220. int valor = Convert.ToInt32(inputtext);
  221.  
  222. if (valor < 1)
  223. {
  224. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  225. return;
  226. }
  227.  
  228. if (Inventory.GetPlayerItemFromInventory(player, 24) < valor)
  229. {
  230. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Aal und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 24) + ".");
  231. return;
  232. }
  233.  
  234. int price = valor * 131;
  235.  
  236. Main.GivePlayerMoney(player, price);
  237. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Aale für $" + price.ToString("N0") + "");
  238. Inventory.RemoveItem(player, "Aal", valor);
  239. }
  240. else if (response == "input_sell_barsch")
  241. {
  242. if (Inventory.GetPlayerItemFromInventory(player, 25) > 0)
  243. {
  244.  
  245. if (!Main.IsNumeric(inputtext))
  246. {
  247. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  248. return;
  249. }
  250.  
  251. int valor = Convert.ToInt32(inputtext);
  252.  
  253. if (valor < 1)
  254. {
  255. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  256. return;
  257. }
  258.  
  259. if (Inventory.GetPlayerItemFromInventory(player, 25) < valor)
  260. {
  261. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Barsche und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 25) + ".");
  262. return;
  263. }
  264.  
  265. int price = valor * 131;
  266.  
  267. Main.GivePlayerMoney(player, price);
  268. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Barsche für $" + price.ToString("N0") + "");
  269. Inventory.RemoveItem(player, "Barsch", valor);
  270. }
  271. else if (response == "input_sell_thunfisch")
  272. {
  273. if (Inventory.GetPlayerItemFromInventory(player, 26) > 0)
  274. {
  275.  
  276. if (!Main.IsNumeric(inputtext))
  277. {
  278. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  279. return;
  280. }
  281.  
  282. int valor = Convert.ToInt32(inputtext);
  283.  
  284. if (valor < 1)
  285. {
  286. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  287. return;
  288. }
  289.  
  290. if (Inventory.GetPlayerItemFromInventory(player, 26) < valor)
  291. {
  292. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Thunfische und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 26) + ".");
  293. return;
  294. }
  295.  
  296. int price = valor * 131;
  297.  
  298. Main.GivePlayerMoney(player, price);
  299. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Thunfische für $" + price.ToString("N0") + "");
  300. Inventory.RemoveItem(player, "Thunfisch", valor);
  301. }
  302. else if (response == "input_sell_seitling")
  303. {
  304. if (Inventory.GetPlayerItemFromInventory(player, 27) > 0)
  305. {
  306.  
  307. if (!Main.IsNumeric(inputtext))
  308. {
  309. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  310. return;
  311. }
  312.  
  313. int valor = Convert.ToInt32(inputtext);
  314.  
  315. if (valor < 1)
  316. {
  317. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  318. return;
  319. }
  320.  
  321. if (Inventory.GetPlayerItemFromInventory(player, 27) < valor)
  322. {
  323. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Seitlinge und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 27) + ".");
  324. return;
  325. }
  326.  
  327. int price = valor * 131;
  328.  
  329. Main.GivePlayerMoney(player, price);
  330. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Seitlinge für $" + price.ToString("N0") + "");
  331. Inventory.RemoveItem(player, "Seitling", valor);
  332. }
  333. else if (response == "input_sell_hering")
  334. {
  335. if (Inventory.GetPlayerItemFromInventory(player, 28) > 0)
  336. {
  337.  
  338. if (!Main.IsNumeric(inputtext))
  339. {
  340. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  341. return;
  342. }
  343.  
  344. int valor = Convert.ToInt32(inputtext);
  345.  
  346. if (valor < 1)
  347. {
  348. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  349. return;
  350. }
  351.  
  352. if (Inventory.GetPlayerItemFromInventory(player, 28) < valor)
  353. {
  354. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Heringe und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 28) + ".");
  355. return;
  356. }
  357.  
  358. int price = valor * 131;
  359.  
  360. Main.GivePlayerMoney(player, price);
  361. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Heringe für $" + price.ToString("N0") + "");
  362. Inventory.RemoveItem(player, "Hering", valor);
  363. }
  364. else if (response == "input_sell_grüneraal")
  365. {
  366. if (Inventory.GetPlayerItemFromInventory(player, 29) > 0)
  367. {
  368.  
  369. if (!Main.IsNumeric(inputtext))
  370. {
  371. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  372. return;
  373. }
  374.  
  375. int valor = Convert.ToInt32(inputtext);
  376.  
  377. if (valor < 1)
  378. {
  379. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  380. return;
  381. }
  382.  
  383. if (Inventory.GetPlayerItemFromInventory(player, 29) < valor)
  384. {
  385. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " grüner Aale und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 29) + ".");
  386. return;
  387. }
  388.  
  389. int price = valor * 131;
  390.  
  391. Main.GivePlayerMoney(player, price);
  392. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x grüner Aale für $" + price.ToString("N0") + "");
  393. Inventory.RemoveItem(player, "grüner Aal", valor);
  394. }
  395.  
  396. else if (response == "input_sell_tintenfisch")
  397. {
  398. if (Inventory.GetPlayerItemFromInventory(player, 30) > 0)
  399. {
  400.  
  401. if (!Main.IsNumeric(inputtext))
  402. {
  403. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  404. return;
  405. }
  406.  
  407. int valor = Convert.ToInt32(inputtext);
  408.  
  409. if (valor < 1)
  410. {
  411. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  412. return;
  413. }
  414.  
  415. if (Inventory.GetPlayerItemFromInventory(player, 30) < valor)
  416. {
  417. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Tintenfische und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 30) + ".");
  418. return;
  419. }
  420.  
  421. int price = valor * 131;
  422.  
  423. Main.GivePlayerMoney(player, price);
  424. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Tintenfische für $" + price.ToString("N0") + "");
  425. Inventory.RemoveItem(player, "Tintenfisch", valor);
  426. }
  427. else if (response == "input_sell_kugelfisch")
  428. {
  429. if (Inventory.GetPlayerItemFromInventory(player, 31) > 0)
  430. {
  431.  
  432. if (!Main.IsNumeric(inputtext))
  433. {
  434. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  435. return;
  436. }
  437.  
  438. int valor = Convert.ToInt32(inputtext);
  439.  
  440. if (valor < 1)
  441. {
  442. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  443. return;
  444. }
  445.  
  446. if (Inventory.GetPlayerItemFromInventory(player, 31) < valor)
  447. {
  448. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " Kugelfische und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 31) + ".");
  449. return;
  450. }
  451.  
  452. int price = valor * 131;
  453.  
  454. Main.GivePlayerMoney(player, price);
  455. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x Kugelfische für $" + price.ToString("N0") + "");
  456. Inventory.RemoveItem(player, "Kugelfisch", valor);
  457. }
  458. else if (response == "input_sell_weißerhai")
  459. {
  460. if (Inventory.GetPlayerItemFromInventory(player, 32) > 0)
  461. {
  462.  
  463. if (!Main.IsNumeric(inputtext))
  464. {
  465. Main.DisplayErrorMessage(player, "Der eingegebene Wert ist nicht numerisch. Bitte geben Sie einen gültigen Wert ein.");
  466. return;
  467. }
  468.  
  469. int valor = Convert.ToInt32(inputtext);
  470.  
  471. if (valor < 1)
  472. {
  473. Main.DisplayErrorMessage(player, "Der von Ihnen eingegebene Wert darf nicht kleiner als 1 sein.");
  474. return;
  475. }
  476.  
  477. if (Inventory.GetPlayerItemFromInventory(player, 32) < valor)
  478. {
  479. Main.DisplayErrorMessage(player, "Sie versuchen zu verkaufen " + valor + " weiße Haie und Sie haben nur " + Inventory.GetPlayerItemFromInventory(player, 32) + ".");
  480. return;
  481. }
  482.  
  483. int price = valor * 131;
  484.  
  485. Main.GivePlayerMoney(player, price);
  486. NAPI.Notification.SendNotificationToPlayer(player, "Du hast verkauft: " + valor + "x weiße Hai für $" + price.ToString("N0") + "");
  487. Inventory.RemoveItem(player, "weißer Hai", valor);
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement