Advertisement
Guest User

Untitled

a guest
Jun 29th, 2015
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.91 KB | None | 0 0
  1. [code=CSHARP]
  2. using Addon;
  3. using System;
  4. using System.Text;
  5. using System.Runtime.InteropServices;
  6. using System.Threading;
  7. using System.Collections.Generic;
  8. using DigitalIdeaSolutions.Collections.Generic;
  9. using MySql.Data.MySqlClient;
  10. namespace mw3shop
  11. {
  12. public class mw3shop : CPlugin
  13. {
  14. MySqlConnection connection;
  15.  
  16. ObservableDictionary<string, int> Points = new ObservableDictionary<string, int>();
  17.  
  18. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage)
  19. {
  20. if (Damage >= Victim.Other.Health && Attacker.Team != Victim.Team && Victim.XUID != Attacker.XUID)
  21. {
  22. try
  23. {
  24. Points[Attacker.XUID] = (((int)Points[Attacker.XUID]) + 100);
  25. iPrintLnBold("^5У тебя уже ^1" + (int)Points[Attacker.XUID] + "^5 очков", Attacker);
  26. }
  27. catch (Exception z)
  28. {
  29. iPrintLn("[^1DEV^7]: " + z.Message, Attacker);
  30. }
  31. }
  32. return Damage;
  33. }
  34.  
  35. unsafe string MW3Console
  36. {
  37. get
  38. {
  39. IntPtr form = *(IntPtr*)0x5933A50;
  40. IntPtr txtbox = FindWindowEx(form, IntPtr.Zero, "Edit", null);
  41. IntPtr console = FindWindowEx(form, txtbox, "Edit", null);
  42. StringBuilder sb = new StringBuilder(9999999);
  43. int result = SendMessageTimeout(console, 0x0D, 9999999, sb, 10, 500, IntPtr.Zero);
  44. return sb.ToString();
  45. }
  46. }
  47. [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)]
  48. public static extern IntPtr FindWindow(string className, string windowName);
  49. [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  50. public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
  51. [DllImport("User32.dll", SetLastError = true)]
  52. public static extern int SendMessageTimeout(
  53. IntPtr hWnd,
  54. uint uMsg,
  55. uint wParam,
  56. StringBuilder lParam,
  57. uint fuFlags,
  58. uint uTimeout,
  59. IntPtr lpdwResult);
  60. public void doConsole(object x)
  61. {
  62. string disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
  63. string disable_tk = GetServerCFG("mw3shop", "disable_tk", "");
  64. string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
  65. while (true)
  66. {
  67. string[] a = MW3Console.Split(new string[] { "\r\n" }, StringSplitOptions.None);
  68. int c = -1;
  69. foreach (string b in a)
  70. {
  71. c++;
  72. if (b == "]shop_sets" && c == a.Length - 2)
  73. {
  74. if (disable_perks == "false")
  75. {
  76. ServerPrint("Перки включены");
  77. }
  78. else
  79. {
  80. ServerPrint("Перки выключены");
  81. }
  82.  
  83. if (clear_perks_onspawn == "true")
  84. {
  85. ServerPrint("Перки исчезают после спавна");
  86. }
  87. else
  88. {
  89. ServerPrint("Перки не исчезают после спавна");
  90. }
  91. }
  92. }
  93. Thread.Sleep(500);
  94. }
  95. }
  96.  
  97. public override void OnServerFrame()
  98. {
  99.  
  100. }
  101.  
  102. public override void OnServerLoad()
  103. {
  104. connection = new MySqlConnection(string.Format("SERVER={0};DATABASE={1};UID={2};PASSWORD={3};", GetServerCFG("Shop", "SERVER", string.Empty), GetServerCFG("Shop", "DB", string.Empty), GetServerCFG("Shop", "USER", string.Empty), GetServerCFG("Shop", "PASSWORD", string.Empty)));
  105. connection.Open();
  106. ServerPrint("MySQL welcome by archit loaded!");
  107. ServerPrint("\n");
  108. ServerPrint("<===Магазин для MW3===>");
  109. ServerPrint("[*] Настроить цену можно открыв sv_config.ini");
  110. ServerPrint("[*] Включить или Отключить перки можно в sv_config.ini");
  111. ServerPrint("[*] Напиши 'shop_sets' здесь, что-бы увидеть настройки");
  112. ServerPrint("[*] Создал JayDi, Спасибо JariZ за помощь.");
  113. ServerPrint("[*] Перевёл ltybcs");
  114. ServerPrint("[*] Плагин загружен!");
  115. ServerPrint("<=======================================>");
  116.  
  117. Points.KeyModified += Points_KeyModified;
  118. setup();
  119.  
  120. ThreadPool.QueueUserWorkItem(new WaitCallback(doConsole));
  121.  
  122.  
  123. }
  124.  
  125. void Points_KeyModified(object sender, KeyModifiedEventArgs<string, int> e)
  126. {
  127. MySqlCommand command = connection.CreateCommand();
  128. command.CommandText = "UPDATE Points SET Point=" + e.NewValue + " WHERE XUID='" + e.Key + "'";
  129. command.ExecuteNonQuery();
  130. }
  131. void setup()
  132. {
  133. if (GetServerCFG("MW3SHOP", "disable_perks", "") == "") { SetServerCFG("MW3SHOP", "disable_perks", "false"); }
  134. if (GetServerCFG("MW3SHOP", "disable_tk", "") == "") { SetServerCFG("MW3SHOP", "disable_tk", "false"); }
  135. if (GetServerCFG("MW3SHOP", "barrettCost", "") == "") { SetServerCFG("MW3SHOP", "barrettCost", "900"); }
  136. if (GetServerCFG("MW3SHOP", "ammoCost", "") == "") { SetServerCFG("MW3SHOP", "ammoCost", "100"); }
  137. if (GetServerCFG("MW3SHOP", "scarCost", "") == "") { SetServerCFG("MW3SHOP", "scarCost", "550"); }
  138. if (GetServerCFG("MW3SHOP", "mk14Cost", "") == "") { SetServerCFG("MW3SHOP", "mk14Cost", "650"); }
  139. if (GetServerCFG("MW3SHOP", "acrCost", "") == "") { SetServerCFG("MW3SHOP", "acrCost", "650"); }
  140. if (GetServerCFG("MW3SHOP", "fadCost", "") == "") { SetServerCFG("MW3SHOP", "fadCost", "700"); }
  141. if (GetServerCFG("MW3SHOP", "m16Cost", "") == "") { SetServerCFG("MW3SHOP", "m16Cost", "500"); }
  142. if (GetServerCFG("MW3SHOP", "ak47Cost", "") == "") { SetServerCFG("MW3SHOP", "ak47Cost", "760"); }
  143. if (GetServerCFG("MW3SHOP", "m4Cost", "") == "") { SetServerCFG("MW3SHOP", "m4Cost", "800"); }
  144. if (GetServerCFG("MW3SHOP", "mg36Cost", "") == "") { SetServerCFG("MW3SHOP", "mg36Cost", "850"); }
  145. if (GetServerCFG("MW3SHOP", "sa80Cost", "") == "") { SetServerCFG("MW3SHOP", "sa80Cost", "700"); }
  146. if (GetServerCFG("MW3SHOP", "cm901Cost", "") == "") { SetServerCFG("MW3SHOP", "cm901Cost", "650"); }
  147. if (GetServerCFG("MW3SHOP", "g36Cost", "") == "") { SetServerCFG("MW3SHOP", "g36Cost", "700"); }
  148. if (GetServerCFG("MW3SHOP", "rsassCost", "") == "") { SetServerCFG("MW3SHOP", "rsassCost", "750"); }
  149. if (GetServerCFG("MW3SHOP", "rpgCost", "") == "") { SetServerCFG("MW3SHOP", "rpgCost", "1010"); }
  150. if (GetServerCFG("MW3SHOP", "xm25Cost", "") == "") { SetServerCFG("MW3SHOP", "xm25Cost", "910"); }
  151. if (GetServerCFG("MW3SHOP", "spasCost", "") == "") { SetServerCFG("MW3SHOP", "spasCost", "510"); }
  152. if (GetServerCFG("MW3SHOP", "usasCost", "") == "") { SetServerCFG("MW3SHOP", "usasCost", "550"); }
  153. if (GetServerCFG("MW3SHOP", "aa12Cost", "") == "") { SetServerCFG("MW3SHOP", "aa12Cost", "650"); }
  154. if (GetServerCFG("MW3SHOP", "strikerCost", "") == "") { SetServerCFG("MW3SHOP", "strikerCost", "580"); }
  155. if (GetServerCFG("MW3SHOP", "modelCost", "") == "") { SetServerCFG("MW3SHOP", "modelCost", "700"); }
  156. if (GetServerCFG("MW3SHOP", "as50Cost", "") == "") { SetServerCFG("MW3SHOP", "as50Cost", "850"); }
  157. if (GetServerCFG("MW3SHOP", "l96a1Cost", "") == "") { SetServerCFG("MW3SHOP", "l96a1Cost", "950"); }
  158. if (GetServerCFG("MW3SHOP", "msrCost", "") == "") { SetServerCFG("MW3SHOP", "msrCost", "1100"); }
  159. if (GetServerCFG("MW3SHOP", "dragCost", "") == "") { SetServerCFG("MW3SHOP", "dragCost", "700"); }
  160. if (GetServerCFG("MW3SHOP", "pechCost", "") == "") { SetServerCFG("MW3SHOP", "pechCost", "900"); }
  161. if (GetServerCFG("MW3SHOP", "mk46Cost", "") == "") { SetServerCFG("MW3SHOP", "mk46Cost", "850"); }
  162. if (GetServerCFG("MW3SHOP", "m60Cost", "") == "") { SetServerCFG("MW3SHOP", "m60Cost", "990"); }
  163. if (GetServerCFG("MW3SHOP", "ump45Cost", "") == "") { SetServerCFG("MW3SHOP", "ump45Cost", "300"); }
  164. if (GetServerCFG("MW3SHOP", "pp90m1Cost", "") == "") { SetServerCFG("MW3SHOP", "pp90m1Cost", "450"); }
  165. if (GetServerCFG("MW3SHOP", "p90Cost", "") == "") { SetServerCFG("MW3SHOP", "p90Cost", "500"); }
  166. if (GetServerCFG("MW3SHOP", "m9Cost", "") == "") { SetServerCFG("MW3SHOP", "m9Cost", "400"); }
  167. if (GetServerCFG("MW3SHOP", "mp7Cost", "") == "") { SetServerCFG("MW3SHOP", "mp7Cost", "650"); }
  168. if (GetServerCFG("MW3SHOP", "mp5Cost", "") == "") { SetServerCFG("MW3SHOP", "mp5Cost", "500"); }
  169. if (GetServerCFG("MW3SHOP", "Stalker_ZCost", "") == "") { SetServerCFG("MW3SHOP", "Stalker_ZCost", "200"); }
  170. if (GetServerCFG("MW3SHOP", "CB_ZCost", "") == "") { SetServerCFG("MW3SHOP", "CB_ZCost", "250"); }
  171. if (GetServerCFG("MW3SHOP", "StalkerCost", "") == "") { SetServerCFG("MW3SHOP", "StalkerCost", "300"); }
  172. if (GetServerCFG("MW3SHOP", "BACost", "") == "") { SetServerCFG("MW3SHOP", "BACost", "400"); }
  173. if (GetServerCFG("MW3SHOP", "CBCost", "") == "") { SetServerCFG("MW3SHOP", "CBCost", "500"); }
  174. if (GetServerCFG("MW3SHOP", "BECost", "") == "") { SetServerCFG("MW3SHOP", "BECost", "300"); }
  175. if (GetServerCFG("MW3SHOP", "ScavengerCost", "") == "") { SetServerCFG("MW3SHOP", "ScavengerCost", "300"); }
  176. if (GetServerCFG("MW3SHOP", "FRCost", "") == "") { SetServerCFG("MW3SHOP", "FRCost", "500"); }
  177. if (GetServerCFG("MW3SHOP", "FMCost", "") == "") { SetServerCFG("MW3SHOP", "FMCost", "450"); }
  178. if (GetServerCFG("MW3SHOP", "TKCost", "") == "") { SetServerCFG("MW3SHOP", "TKCost", "1500"); }
  179. if (GetServerCFG("MW3SHOP", "EmpGrenadeCost", "") == "") { SetServerCFG("MW3SHOP", "EmpGrenadeCost", "50"); }
  180. if (GetServerCFG("MW3SHOP", "clear_perks_onspawn", "") == "") { SetServerCFG("MW3SHOP", "clear_perks_onspawn", "false"); }
  181. if (GetServerCFG("MW3SHOP", "claymoreCost", "") == "") { SetServerCFG("MW3SHOP", "claymoreCost", "420"); }
  182. if (GetServerCFG("MW3SHOP", "ak47aCost", "") == "") { SetServerCFG("MW3SHOP", "ak47aCost", "10000"); }
  183. if (GetServerCFG("MW3SHOP", "ammo_zCost", "") == "") { SetServerCFG("MW3SHOP", "ammo_zCost", "5000"); }
  184. if (GetServerCFG("MW3SHOP", "cxCost", "") == "") { SetServerCFG("MW3SHOP", "cxCost", "3000"); }
  185. if (GetServerCFG("MW3SHOP", "dCost", "") == "") { SetServerCFG("MW3SHOP", "dCost", "5000"); }
  186. if (GetServerCFG("MW3SHOP", "bronCost", "") == "") { SetServerCFG("MW3SHOP", "bronCost", "4000"); }
  187. if (GetServerCFG("MW3SHOP", "bron_zCost", "") == "") { SetServerCFG("MW3SHOP", "bron_zCost", "5000"); }
  188. if (GetServerCFG("MW3SHOP", "AC130_25mmCost", "") == "") { SetServerCFG("MW3SHOP", "AC130_25mmCost", "17500"); }
  189. }
  190. public override void OnPlayerConnect(ServerClient Client)
  191. {
  192.  
  193. }
  194.  
  195. public override ChatType OnSay(string Message, ServerClient Client)
  196. {
  197. try
  198. {
  199.  
  200. // POINTS
  201. int points = (int)Points[Client.XUID];
  202.  
  203.  
  204. // SHOWS
  205. string EmpGrenadeCost = GetServerCFG("mw3shop", "EmpGrenadeCost", "");
  206. string TKCost = GetServerCFG("mw3shop", "TKCost", "");
  207. // PERKS
  208. string FMCost = GetServerCFG("mw3shop", "FMCost", "");
  209. string FRCost = GetServerCFG("mw3shop", "FRCost", "");
  210. string ScavengerCost = GetServerCFG("mw3shop", "ScavengerCost", "");
  211. string BECost = GetServerCFG("mw3shop", "BECost", "");
  212. string CBCost = GetServerCFG("mw3shop", "CBCost", "");
  213. string BACost = GetServerCFG("mw3shop", "BACost", "");
  214. string StalkerCost = GetServerCFG("mw3shop", "StalkerCost", "");
  215. string CB_ZCost = GetServerCFG("mw3shop", "CB_ZCost", "");
  216. string Stalker_ZCost = GetServerCFG("mw3shop", "Stalker_ZCost", "");
  217. // weapons
  218. string mp5Cost = GetServerCFG("mw3shop", "mp5Cost", "");
  219. string mp7Cost = GetServerCFG("mw3shop", "mp7Cost", "");
  220. string m9Cost = GetServerCFG("mw3shop", "m9Cost", "");
  221. string p90Cost = GetServerCFG("mw3shop", "p90Cost", "");
  222. string pp90m1Cost = GetServerCFG("mw3shop", "pp90m1Cost", "");
  223. string ump45Cost = GetServerCFG("mw3shop", "ump45Cost", "");
  224. string m60Cost = GetServerCFG("mw3shop", "m60Cost", "");
  225. string mk46Cost = GetServerCFG("mw3shop", "mk46Cost", "");
  226. string pechCost = GetServerCFG("mw3shop", "pechCost", "");
  227. string sa80Cost = GetServerCFG("mw3shop", "sa80Cost", "");
  228. string mg36Cost = GetServerCFG("mw3shop", "mg36Cost", "");
  229. string m4Cost = GetServerCFG("mw3shop", "m4Cost", "");
  230. string ak47Cost = GetServerCFG("mw3shop", "ak47Cost", "");
  231. string m16Cost = GetServerCFG("mw3shop", "m16Cost", "");
  232. string fadCost = GetServerCFG("mw3shop", "fadCost", "");
  233. string acrCost = GetServerCFG("mw3shop", "acrCost", "");
  234. string mk14Cost = GetServerCFG("mw3shop", "mk14Cost", "");
  235. string scarCost = GetServerCFG("mw3shop", "scarCost", "");
  236. string g36Cost = GetServerCFG("mw3shop", "g36Cost", "");
  237. string cm901Cost = GetServerCFG("mw3shop", "cm901Cost", "");
  238. string barrettCost = GetServerCFG("mw3shop", "barrettCost", "");
  239. string rsassCost = GetServerCFG("mw3shop", "rsassCost", "");
  240. string dragCost = GetServerCFG("mw3shop", "dragCost", "");
  241. string msrCost = GetServerCFG("mw3shop", "msrCost", "");
  242. string l96a1Cost = GetServerCFG("mw3shop", "l96a1Cost", "");
  243. string as50Cost = GetServerCFG("mw3shop", "as50Cost", "");
  244. string modelCost = GetServerCFG("mw3shop", "modelCost", "");
  245. string strikerCost = GetServerCFG("mw3shop", "strikerCost", "");
  246. string aa12Cost = GetServerCFG("mw3shop", "aa12Cost", "");
  247. string usasCost = GetServerCFG("mw3shop", "usasCost", "");
  248. string spasCost = GetServerCFG("mw3shop", "spasCost", "");
  249. string xm25Cost = GetServerCFG("mw3shop", "xm25Cost", "");
  250. string rpgCost = GetServerCFG("mw3shop", "rpgCost", "");
  251. string ammoCost = GetServerCFG("mw3shop", "ammoCost", "");
  252. string ZHPCost = GetServerCFG("mw3shop", "zHPCost", "");
  253. string claymoreCost = GetServerCFG("mw3shop", "claymoreCost", "");
  254. string ak47aCost = GetServerCFG("mw3shop", "ak47aCost", "");
  255. string ammo_zCost = GetServerCFG("mw3shop", "ammo_zCost", "");
  256. string cxCost = GetServerCFG("mw3shop", "cxCost", "");
  257. string dCost = GetServerCFG("mw3shop", "dCost", "");
  258. string bronCost = GetServerCFG("mw3shop", "bronCost", "");
  259. string bron_zCost = GetServerCFG("mw3shop", "bron_zCost", "");
  260. string AC130_25mmCost = GetServerCFG("mw3shop", "AC130_25mmCost", "");
  261. string disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
  262. if (Message == "!z_info")
  263. {
  264. iPrintLnBold("^2This is zombie survival. Collect points to upgrade yourself!", Client);
  265. return ChatType.ChatNone;
  266. }
  267. // SHOP
  268.  
  269. if (Message == "!tut")
  270. {
  271. iPrintLnBold("^2Что-бы открыть магазин введите !shop.", Client);
  272. return ChatType.ChatNone;
  273. }
  274. if (Message == "!mypoints")
  275. {
  276. iPrintLnBold("^2Твои очки: " + points, Client);
  277. return ChatType.ChatNone;
  278. }
  279. if (Message == "!credits")
  280. {
  281. iPrintLnBold("^2Создатель JayDi. Перевод ltybcs", Client);
  282. return ChatType.ChatNone;
  283. }
  284.  
  285.  
  286. if (Message == "!shop")
  287. {
  288. if (Client.Team == Teams.Allies)
  289. {
  290. TellClient(Client.ClientNum, "^1Ведите !weapons чтобы посмотреть список оружия на покупку | Ведите !perks чтобы посмотреть какие перки можно купить", true);
  291. return ChatType.ChatNone;
  292. }
  293. if (Client.Team == Teams.Axis)
  294. {
  295. TellClient(Client.ClientNum, "^3!emp ^2[" + EmpGrenadeCost + "]^1Эми граната^7|^3!tk ^2[" + TKCost + "]^1-Металка^7|^3!ammo ^2[" + ammo_zCost + "]^1-2 обоймы^7|^3!8 ^2[" + cxCost + "]^1-Cемтекс^7|^3!60^7[" + bron_zCost + "]-^2Джагернаут!", true);
  296. return ChatType.ChatNone;
  297. }
  298. return ChatType.ChatNone;
  299. }
  300.  
  301. if (Message == "!weapons")
  302. {
  303. if (Client.Team == Teams.Allies)
  304. {
  305. TellClient(Client.ClientNum, "!1^7-^2ПП^7|^3!2^7-^2Ручники^7|^3!3^7-^2Автоматы^7|^3!4^7-^2Снайпы^7|^3!5^7-^2Дробовики^7|^3!6^7-^2Взрывчатка", true);
  306. return ChatType.ChatNone;
  307. }
  308. if (Client.Team == Teams.Axis)
  309. {
  310. TellClient(Client.ClientNum, "^1Зомби не могут использовать эту команду", true);
  311. return ChatType.ChatNone;
  312. }
  313. return ChatType.ChatNone;
  314. }
  315. if (Message == "!perks")
  316. {
  317.  
  318. if (Client.Team == Teams.Allies)
  319. {
  320. TellClient(Client.ClientNum, "^3!fm^2[" + FMCost + "]^1-ускорение рукапашки^7|^3!fr^2[" + FRCost + "]^1-Ловкость рук^7|^3n!be^2[" + BECost + "]^1-Неведимка^7|^3!cb^2[" + CBCost + "]^1-Убийца^7|^3!ba^2[" + BACost + "]^1-Твёрдая рука^7|^3!s^2[" + StalkerCost + "]^1-Сталкер", true);
  321. return ChatType.ChatNone;
  322. }
  323. if (Client.Team == Teams.Axis)
  324. {
  325. TellClient(Client.ClientNum, "^3!cb^2[" + CB_ZCost + "]^1-Убийца^7|^3!s ^2[" + Stalker_ZCost + "]^1-Сталкер^3", true);
  326. return ChatType.ChatNone;
  327. }
  328.  
  329. return ChatType.ChatNone;
  330. }
  331. // WEAPONS
  332.  
  333. if (Message == "!1")
  334. {
  335. /*
  336. iw5_mp5
  337. iw5_mp7
  338. iw5_m9
  339. iw5_p90
  340. iw5_pp90m1
  341. iw5_ump45
  342. */
  343. TellClient(Client.ClientNum, "^3!11^2[" + mp5Cost + "]^1-MP5^7|^3!12^2[" + mp7Cost + "]^1-MP7^7|^3!13^2[" + m9Cost + "]^1-M9^7|^314^2[" + p90Cost + "]^1-P90^7|^3!15^2[" + pp90m1Cost + "]^1-PP90M1^7|^3!16^2[" + ump45Cost + "]^1-UMP45", true);
  344. return ChatType.ChatNone;
  345. }
  346. if (Message == "!2")
  347. {
  348. /*
  349. iw5_m60
  350. iw5_mk46
  351. iw5_pecheneg
  352. iw5_sa80
  353. iw5_mg36
  354. */
  355. TellClient(Client.ClientNum, "^3!21^2[" + m60Cost + "]^1-M60^7|^3!22^2[" + mk46Cost + "]^1-MK46^7|^3!23^2[" + pechCost + "]^1-Печенег^7|^3!24^2[" + sa80Cost + "]^1-SA80^7|^3!25^2[" + mg36Cost + "]^1-MG36", true);
  356. return ChatType.ChatNone;
  357. }
  358. if (Message == "!3")
  359. {
  360. /*
  361. iw5_m4
  362. iw5_ak47
  363. iw5_m16
  364. iw5_fad
  365. iw5_acr
  366. iw5_mk14
  367. iw5_scar
  368. iw5_g36c
  369. iw5_cm901
  370. */
  371. TellClient(Client.ClientNum, "^3!31^2[" + m4Cost + "]^1-M4A1^7|^3!32^2[" + ak47Cost + "]^1-AK-47^7|^3!33^2[" + m16Cost + "]^1-M16^7|^3!34^2[" + fadCost + "]^1-FAD^7|^3!35^2[" + acrCost + "]^1-ACR 6.8^7|^3!36^2[" + mk14Cost + "]^1-MK14^7|^3!37^2[" + scarCost + "]^1-SCAR^7|^3!38^2[" + g36Cost + "]^1-G36^7|^3!39^2[" + cm901Cost + "]^1-CM901", true);
  372. return ChatType.ChatNone;
  373. }
  374.  
  375. if (Message == "!4")
  376. {
  377. /*
  378. iw5_barrett
  379. iw5_rsass
  380. iw5_dragunov
  381. iw5_msr
  382. iw5_l96a1
  383. iw5_as50
  384.  
  385. */
  386. TellClient(Client.ClientNum, "^3!41^2[" + barrettCost + "]^1-BARRET^7|^3!42^2[" + rsassCost + "]^1-RSSAS^7|^3!43^2[" + dragCost + "]^1-DRAGYNOV^7|^3!44^2[" + msrCost + "]^1-MSR^7|^3!45^2[" + l96a1Cost + "]^1-L96A1^7|^3!46^2[" + as50Cost + "]^1-AS50", true);
  387. return ChatType.ChatNone;
  388. }
  389.  
  390. if (Message == "!5")
  391. {
  392. /*
  393. iw5_1887
  394. iw5_striker
  395. iw5_aa12
  396. iw5_usas12
  397. iw5_spas12
  398. */
  399. TellClient(Client.ClientNum, "^3!51^2[" + modelCost + "]^1-MODEL 1887^7|^3!52^2[" + strikerCost + "]^1-SRIKER^7|^3!53^2[" + aa12Cost + "]^1-AA12^7|^3!54^2[" + usasCost + "]^1-USAS^7|^3!55^2[" + spasCost + "]^1-SPAS", true);
  400. return ChatType.ChatNone;
  401. }
  402. if (Message == "!6")
  403. {
  404. /*xm25*/
  405. TellClient(Client.ClientNum, "^3!61^2[" + rpgCost + "]^1-RPG^7|^3!62^2[" + xm25Cost + "]^1-XM25^7|^3!65^2[" + claymoreCost + "]^1-Клеймор", true);
  406. return ChatType.ChatNone;
  407. }
  408. if (Message == "!7")
  409. {
  410. /*xm25*/
  411. TellClient(Client.ClientNum, "^3!ak47a^7[" + ak47aCost + "]-^2АК47 АКИМБО!^7|^3!8^7[" + dCost + "]-^2Усиленный дигл!^7|^3!10^7[" + bronCost + "]-^2Броня!^7|^3!59^7[" + AC130_25mmCost + "]-^2Пушка 25mm от AC130!", true);
  412. return ChatType.ChatNone;
  413. }
  414. // BUY SYSTEMS
  415. if (Client.Team == Teams.Allies)
  416. {
  417. if (Message == "!59")
  418. {
  419. int AC130_25mmCost2 = Convert.ToInt32(AC130_25mmCost);
  420. if ((int)Points[Client.XUID] < AC130_25mmCost2)
  421. {
  422. iPrintLnBold("^1Не хватает очков!", Client);
  423. }
  424. else
  425. {
  426. int WepID = GetWeapon("ac130_25mm_mp");
  427.  
  428. Client.Other.PrimaryWeaponAkimbo = false;
  429. Client.Other.SecondaryWeaponAkimbo = false;
  430. Client.Other.PrimaryWeapon = WepID;
  431. Client.Ammo.PrimaryAmmo = 9999;
  432. Points[Client.XUID] = ((int)Points[Client.XUID]) - AC130_25mmCost2;
  433. }
  434. return ChatType.ChatNone;
  435. }
  436. if (Message == "!10")
  437. {
  438. int bronCost2 = Convert.ToInt32(bronCost);
  439. if ((int)Points[Client.XUID] < bronCost2)
  440. {
  441. iPrintLnBold("^1Не хватает очков!", Client);
  442. }
  443. else
  444. {
  445. iPrintLnBold("^2Куплена броня!", Client);
  446. Client.Other.Health = Client.Other.Health + 150;
  447. }
  448. return ChatType.ChatNone;
  449. }
  450. if (Message == "!ammo")
  451. {
  452. int ammoCost2 = Convert.ToInt32(ammoCost);
  453. if ((int)Points[Client.XUID] < ammoCost2)
  454. {
  455. iPrintLnBold("^1Не хватает очков!", Client);
  456. }
  457. else
  458. {
  459. iPrintLnBold("^2Куплено 200 потронов!", Client);
  460. Client.Ammo.PrimaryAmmoClip = 200;
  461. Points[Client.XUID] = ((int)Points[Client.XUID]) - ammoCost2;
  462. }
  463. return ChatType.ChatNone;
  464. }
  465. if (Message == "!ak47a")
  466. {
  467. int ak47aCost2 = Convert.ToInt32(ak47aCost);
  468. if ((int)Points[Client.XUID] < ak47aCost2)
  469. {
  470. iPrintLnBold("^1Не хватает очков!", Client);
  471. }
  472. else
  473. {
  474. int WepID = GetWeapon("iw5_ak47_mp");
  475. Client.Other.PrimaryWeaponAkimbo = true;
  476. Client.Other.PrimaryWeapon = WepID;
  477. Client.Ammo.PrimaryAmmoClip = 1034;
  478. Points[Client.XUID] = ((int)Points[Client.XUID]) - ak47aCost2;
  479. }
  480. return ChatType.ChatNone;
  481. }
  482. // smgs
  483. if (Message == "!8")
  484. {
  485. int dCost2 = Convert.ToInt32(dCost);
  486. if ((int)Points[Client.XUID] < dCost2)
  487. {
  488. iPrintLnBold("^1Не хватает очков!", Client);
  489. }
  490. else
  491. {
  492. int WepID = GetWeapon("iw5_deserteagle_mp");
  493. Client.Other.PrimaryWeaponAkimbo = false;
  494. Client.Other.SecondaryWeaponAkimbo = false;
  495. Client.Other.PrimaryWeapon = WepID;
  496. Client.Other.CurrentWeapon = WepID;
  497. Client.Ammo.PrimaryAmmoClip = 50;
  498. Client.Ammo.PrimaryAmmo = 8;
  499. Points[Client.XUID] = ((int)Points[Client.XUID]) - dCost2;
  500. }
  501. return ChatType.ChatNone;
  502. }
  503. if (Message == "!11")
  504. {
  505. int mp5Cost2 = Convert.ToInt32(mp5Cost);
  506. if ((int)Points[Client.XUID] < mp5Cost2)
  507. {
  508. iPrintLnBold("^1Не хватает очков!", Client);
  509. }
  510. else
  511. {
  512. int WepID = GetWeapon("iw5_mp5_mp");
  513. Client.Other.PrimaryWeaponAkimbo = false;
  514. Client.Other.SecondaryWeaponAkimbo = false;
  515. Client.Other.PrimaryWeapon = WepID;
  516. Client.Other.CurrentWeapon = WepID;
  517. Client.Ammo.PrimaryAmmoClip = 200;
  518. Points[Client.XUID] = ((int)Points[Client.XUID]) - mp5Cost2;
  519. }
  520. return ChatType.ChatNone;
  521. }
  522. if (Message == "!12")
  523. {
  524.  
  525. int mp7Cost2 = Convert.ToInt32(mp7Cost);
  526. if ((int)Points[Client.XUID] < mp7Cost2)
  527. {
  528. iPrintLnBold("^1Не хватает очков!", Client);
  529. }
  530. else
  531. {
  532. int WepID = GetWeapon("iw5_mp7_mp");
  533. Client.Other.PrimaryWeaponAkimbo = false;
  534. Client.Other.SecondaryWeaponAkimbo = false;
  535. Client.Other.PrimaryWeapon = WepID;
  536. Client.Other.CurrentWeapon = WepID;
  537. Client.Ammo.PrimaryAmmoClip = 200;
  538. Points[Client.XUID] = ((int)Points[Client.XUID]) - mp7Cost2;
  539. }
  540.  
  541. return ChatType.ChatNone;
  542. }
  543. if (Message == "!13")
  544. {
  545. int m9Cost2 = Convert.ToInt32(m9Cost);
  546. if ((int)Points[Client.XUID] < m9Cost2)
  547. {
  548. iPrintLnBold("^1Не хватает очков!", Client);
  549. }
  550. else
  551. {
  552. int WepID = GetWeapon("iw5_m9_mp");
  553. Client.Other.PrimaryWeaponAkimbo = false;
  554. Client.Other.SecondaryWeaponAkimbo = false;
  555. Client.Other.PrimaryWeapon = WepID;
  556. Client.Other.CurrentWeapon = WepID;
  557. Client.Ammo.PrimaryAmmoClip = 200;
  558. Points[Client.XUID] = ((int)Points[Client.XUID]) - m9Cost2;
  559. }
  560.  
  561. return ChatType.ChatNone;
  562. }
  563. if (Message == "!14")
  564. {
  565. int p90Cost2 = Convert.ToInt32(p90Cost);
  566. if ((int)Points[Client.XUID] < p90Cost2)
  567. {
  568. iPrintLnBold("^1Не хватает очков!", Client);
  569. }
  570. else
  571. {
  572. int WepID = GetWeapon("iw5_p90_mp");
  573. Client.Other.PrimaryWeaponAkimbo = false;
  574. Client.Other.SecondaryWeaponAkimbo = false;
  575. Client.Other.PrimaryWeapon = WepID;
  576. Client.Other.CurrentWeapon = WepID;
  577. Client.Ammo.PrimaryAmmoClip = 200;
  578. Points[Client.XUID] = ((int)Points[Client.XUID]) - p90Cost2;
  579. }
  580.  
  581. return ChatType.ChatNone;
  582. }
  583. if (Message == "!15")
  584. {
  585. int pp90m1Cost2 = Convert.ToInt32(pp90m1Cost);
  586. if ((int)Points[Client.XUID] < pp90m1Cost2)
  587. {
  588. iPrintLnBold("^1Не хватает очков!", Client);
  589. }
  590. else
  591. {
  592. int WepID = GetWeapon("iw5_pp90m1_mp");
  593. Client.Other.PrimaryWeaponAkimbo = false;
  594. Client.Other.SecondaryWeaponAkimbo = false;
  595. Client.Other.PrimaryWeapon = WepID;
  596. Client.Other.CurrentWeapon = WepID;
  597. Client.Ammo.PrimaryAmmoClip = 200;
  598. Points[Client.XUID] = ((int)Points[Client.XUID]) - pp90m1Cost2;
  599. }
  600.  
  601. return ChatType.ChatNone;
  602. }
  603. if (Message == "!16")
  604. {
  605. int ump45Cost2 = Convert.ToInt32(ump45Cost);
  606. if ((int)Points[Client.XUID] < ump45Cost2)
  607. {
  608. iPrintLnBold("^1Не хватает очков!", Client);
  609. }
  610. else
  611. {
  612. int WepID = GetWeapon("iw5_ump45_mp");
  613. Client.Other.PrimaryWeaponAkimbo = false;
  614. Client.Other.SecondaryWeaponAkimbo = false;
  615. Client.Other.PrimaryWeapon = WepID;
  616. Client.Other.CurrentWeapon = WepID;
  617. Client.Ammo.PrimaryAmmoClip = 200;
  618. Points[Client.XUID] = ((int)Points[Client.XUID]) - ump45Cost2;
  619. }
  620.  
  621. return ChatType.ChatNone;
  622. }
  623.  
  624. //lmgs
  625. if (Message == "!21")
  626. {
  627. int m60Cost2 = Convert.ToInt32(m60Cost);
  628. if ((int)Points[Client.XUID] < m60Cost2)
  629. {
  630. iPrintLnBold("^1Не хватает очков!", Client);
  631. }
  632. else
  633. {
  634. int WepID = GetWeapon("iw5_m60_mp");
  635. Client.Other.PrimaryWeaponAkimbo = false;
  636. Client.Other.SecondaryWeaponAkimbo = false;
  637. Client.Other.PrimaryWeapon = WepID;
  638. Client.Other.CurrentWeapon = WepID;
  639. Client.Ammo.PrimaryAmmoClip = 300;
  640. Points[Client.XUID] = ((int)Points[Client.XUID]) - m60Cost2;
  641. }
  642.  
  643. return ChatType.ChatNone;
  644. }
  645. if (Message == "!22")
  646. {
  647. int mk46Cost2 = Convert.ToInt32(mk46Cost);
  648. if ((int)Points[Client.XUID] < mk46Cost2)
  649. {
  650. iPrintLnBold("^1Не хватает очков!", Client);
  651. }
  652. else
  653. {
  654. int WepID = GetWeapon("iw5_mk46_mp");
  655. Client.Other.PrimaryWeaponAkimbo = false;
  656. Client.Other.SecondaryWeaponAkimbo = false;
  657. Client.Other.PrimaryWeapon = WepID;
  658. Client.Other.CurrentWeapon = WepID;
  659. Client.Ammo.PrimaryAmmoClip = 300;
  660. Points[Client.XUID] = ((int)Points[Client.XUID]) - mk46Cost2;
  661. }
  662.  
  663. return ChatType.ChatNone;
  664. }
  665. if (Message == "!23")
  666. {
  667. int pechCost2 = Convert.ToInt32(pechCost);
  668. if ((int)Points[Client.XUID] < pechCost2)
  669. {
  670. iPrintLnBold("^1Не хватает очков!", Client);
  671. }
  672. else
  673. {
  674. int WepID = GetWeapon("iw5_pecheneg_mp");
  675. Client.Other.PrimaryWeaponAkimbo = false;
  676. Client.Other.SecondaryWeaponAkimbo = false;
  677. Client.Other.PrimaryWeapon = WepID;
  678. Client.Other.CurrentWeapon = WepID;
  679. Client.Ammo.PrimaryAmmoClip = 300;
  680. Points[Client.XUID] = ((int)Points[Client.XUID]) - pechCost2;
  681. }
  682.  
  683. return ChatType.ChatNone;
  684. }
  685. if (Message == "!24")
  686. {
  687. int sa80Cost2 = Convert.ToInt32(sa80Cost);
  688. if ((int)Points[Client.XUID] < sa80Cost2)
  689. {
  690. iPrintLnBold("^1Не хватает очков!", Client);
  691. }
  692. else
  693. {
  694. int WepID = GetWeapon("iw5_sa80_mp");
  695. Client.Other.PrimaryWeaponAkimbo = false;
  696. Client.Other.SecondaryWeaponAkimbo = false;
  697. Client.Other.PrimaryWeapon = WepID;
  698. Client.Other.CurrentWeapon = WepID;
  699. Client.Ammo.PrimaryAmmoClip = 300;
  700. Points[Client.XUID] = ((int)Points[Client.XUID]) - sa80Cost2;
  701. }
  702.  
  703. return ChatType.ChatNone;
  704. }
  705. if (Message == "!25")
  706. {
  707. int mg36Cost2 = Convert.ToInt32(mg36Cost);
  708. if ((int)Points[Client.XUID] < mg36Cost2)
  709. {
  710. iPrintLnBold("^1Не хватает очков!", Client);
  711. }
  712. else
  713. {
  714. int WepID = GetWeapon("iw5_mg36_mp");
  715. Client.Other.PrimaryWeaponAkimbo = false;
  716. Client.Other.SecondaryWeaponAkimbo = false;
  717. Client.Other.PrimaryWeapon = WepID;
  718. Client.Other.CurrentWeapon = WepID;
  719. Client.Ammo.PrimaryAmmoClip = 300;
  720. Points[Client.XUID] = ((int)Points[Client.XUID]) - mg36Cost2;
  721. }
  722.  
  723. return ChatType.ChatNone;
  724. }
  725.  
  726. // assaults
  727. if (Message == "!31")
  728. {
  729. int m4Cost2 = Convert.ToInt32(m4Cost);
  730. if ((int)Points[Client.XUID] < m4Cost2)
  731. {
  732. iPrintLnBold("^1Не хватает очков!", Client);
  733. }
  734. else
  735. {
  736. int WepID = GetWeapon("iw5_m4_mp");
  737. Client.Other.PrimaryWeaponAkimbo = false;
  738. Client.Other.SecondaryWeaponAkimbo = false;
  739. Client.Other.PrimaryWeapon = WepID;
  740. Client.Other.CurrentWeapon = WepID;
  741. Client.Ammo.PrimaryAmmoClip = 200;
  742. Points[Client.XUID] = ((int)Points[Client.XUID]) - m4Cost2;
  743. }
  744.  
  745. return ChatType.ChatNone;
  746. }
  747. if (Message == "!32")
  748. {
  749. int ak47Cost2 = Convert.ToInt32(ak47Cost);
  750. if ((int)Points[Client.XUID] < ak47Cost2)
  751. {
  752. iPrintLnBold("^1Не хватает очков!", Client);
  753. }
  754. else
  755. {
  756. int WepID = GetWeapon("iw5_ak47_mp");
  757. Client.Other.PrimaryWeaponAkimbo = false;
  758. Client.Other.SecondaryWeaponAkimbo = false;
  759. Client.Other.PrimaryWeapon = WepID;
  760. Client.Other.CurrentWeapon = WepID;
  761. Client.Ammo.PrimaryAmmoClip = 200;
  762. Points[Client.XUID] = ((int)Points[Client.XUID]) - ak47Cost2;
  763. }
  764.  
  765. return ChatType.ChatNone;
  766. }
  767. if (Message == "!33")
  768. {
  769. int m16Cost2 = Convert.ToInt32(m16Cost);
  770. if ((int)Points[Client.XUID] < m16Cost2)
  771. {
  772. iPrintLnBold("^1Не хватает очков!", Client);
  773. }
  774. else
  775. {
  776. int WepID = GetWeapon("iw5_m16_mp");
  777. Client.Other.PrimaryWeaponAkimbo = false;
  778. Client.Other.SecondaryWeaponAkimbo = false;
  779. Client.Other.PrimaryWeapon = WepID;
  780. Client.Other.CurrentWeapon = WepID;
  781. Client.Ammo.PrimaryAmmoClip = 200;
  782. Points[Client.XUID] = ((int)Points[Client.XUID]) - m16Cost2;
  783. }
  784.  
  785. return ChatType.ChatNone;
  786. }
  787. if (Message == "!34")
  788. {
  789. int fadCost2 = Convert.ToInt32(fadCost);
  790. if ((int)Points[Client.XUID] < fadCost2)
  791. {
  792. iPrintLnBold("^1Не хватает очков!", Client);
  793. }
  794. else
  795. {
  796. int WepID = GetWeapon("iw5_fad_mp");
  797. Client.Other.PrimaryWeaponAkimbo = false;
  798. Client.Other.SecondaryWeaponAkimbo = false;
  799. Client.Other.PrimaryWeapon = WepID;
  800. Client.Other.CurrentWeapon = WepID;
  801. Client.Ammo.PrimaryAmmoClip = 200;
  802. Points[Client.XUID] = ((int)Points[Client.XUID]) - fadCost2;
  803. }
  804.  
  805. return ChatType.ChatNone;
  806. }
  807. if (Message == "!35")
  808. {
  809. int acrCost2 = Convert.ToInt32(acrCost);
  810. if ((int)Points[Client.XUID] < acrCost2)
  811. {
  812. iPrintLnBold("^1Не хватает очков!", Client);
  813. }
  814. else
  815. {
  816. int WepID = GetWeapon("iw5_acr_mp");
  817. Client.Other.PrimaryWeaponAkimbo = false;
  818. Client.Other.SecondaryWeaponAkimbo = false;
  819. Client.Other.PrimaryWeapon = WepID;
  820. Client.Other.CurrentWeapon = WepID;
  821. Client.Ammo.PrimaryAmmoClip = 200;
  822. Points[Client.XUID] = ((int)Points[Client.XUID]) - acrCost2;
  823. }
  824.  
  825. return ChatType.ChatNone;
  826. }
  827. if (Message == "!36")
  828. {
  829. int mk14Cost2 = Convert.ToInt32(mk14Cost);
  830. if ((int)Points[Client.XUID] < mk14Cost2)
  831. {
  832. iPrintLnBold("^1Не хватает очков!", Client);
  833. }
  834. else
  835. {
  836. int WepID = GetWeapon("iw5_mk14_mp");
  837. Client.Other.PrimaryWeaponAkimbo = false;
  838. Client.Other.SecondaryWeaponAkimbo = false;
  839. Client.Other.PrimaryWeapon = WepID;
  840. Client.Other.CurrentWeapon = WepID;
  841. Client.Ammo.PrimaryAmmoClip = 200;
  842. Points[Client.XUID] = ((int)Points[Client.XUID]) - mk14Cost2;
  843. }
  844.  
  845. return ChatType.ChatNone;
  846. }
  847. if (Message == "!37")
  848. {
  849. int scarCost2 = Convert.ToInt32(scarCost);
  850. if ((int)Points[Client.XUID] < scarCost2)
  851. {
  852. iPrintLnBold("^1Не хватает очков!", Client);
  853. }
  854. else
  855. {
  856. int WepID = GetWeapon("iw5_scar_mp");
  857. Client.Other.PrimaryWeaponAkimbo = false;
  858. Client.Other.SecondaryWeaponAkimbo = false;
  859. Client.Other.PrimaryWeapon = WepID;
  860. Client.Other.CurrentWeapon = WepID;
  861. Client.Ammo.PrimaryAmmoClip = 200;
  862. Points[Client.XUID] = ((int)Points[Client.XUID]) - scarCost2;
  863. }
  864.  
  865. return ChatType.ChatNone;
  866. }
  867. if (Message == "!38")
  868. {
  869. int g36Cost2 = Convert.ToInt32(g36Cost);
  870. if ((int)Points[Client.XUID] < g36Cost2)
  871. {
  872. iPrintLnBold("^1Не хватает очков!", Client);
  873. }
  874. else
  875. {
  876. int WepID = GetWeapon("iw5_g36c_mp");
  877. Client.Other.PrimaryWeaponAkimbo = false;
  878. Client.Other.SecondaryWeaponAkimbo = false;
  879. Client.Other.PrimaryWeapon = WepID;
  880. Client.Other.CurrentWeapon = WepID;
  881. Client.Ammo.PrimaryAmmoClip = 200;
  882. Points[Client.XUID] = ((int)Points[Client.XUID]) - g36Cost2;
  883. }
  884.  
  885. return ChatType.ChatNone;
  886. }
  887. if (Message == "!39")
  888. {
  889. int cm901Cost2 = Convert.ToInt32(cm901Cost);
  890. if ((int)Points[Client.XUID] < cm901Cost2)
  891. {
  892. iPrintLnBold("^1Не хватает очков!", Client);
  893. }
  894. else
  895. {
  896. int WepID = GetWeapon("iw5_cm901_mp");
  897. Client.Other.PrimaryWeaponAkimbo = false;
  898. Client.Other.SecondaryWeaponAkimbo = false;
  899. Client.Other.PrimaryWeapon = WepID;
  900. Client.Other.CurrentWeapon = WepID;
  901. Client.Ammo.PrimaryAmmoClip = 200;
  902. Points[Client.XUID] = ((int)Points[Client.XUID]) - cm901Cost2;
  903. }
  904.  
  905. return ChatType.ChatNone;
  906. }
  907. if (Message == "!65")
  908. {
  909. int cmCost2 = Convert.ToInt32(claymoreCost);
  910. if ((int)Points[Client.XUID] < cmCost2)
  911. {
  912. iPrintLnBold("^1Не хватает очков!", Client);
  913. }
  914. else
  915. {
  916. int WepID = GetWeapon("claymore_mp");
  917. Client.Other.PrimaryWeaponAkimbo = false;
  918. Client.Other.SecondaryWeaponAkimbo = false;
  919. Client.Other.Equipment = WepID;
  920. Client.Ammo.EquipmentAmmo = 2;
  921. Points[Client.XUID] = ((int)Points[Client.XUID]) - cmCost2;
  922. }
  923.  
  924. return ChatType.ChatNone;
  925. }
  926. //snipers
  927. if (Message == "!41")
  928. {
  929. int barrettCost2 = Convert.ToInt32(barrettCost);
  930. if ((int)Points[Client.XUID] < barrettCost2)
  931. {
  932. iPrintLnBold("^1Не хватает очков!", Client);
  933. }
  934. else
  935. {
  936. int WepID = GetWeapon("iw5_barrett_mp_barrettscope");
  937. Client.Other.PrimaryWeaponAkimbo = false;
  938. Client.Other.SecondaryWeaponAkimbo = false;
  939. Client.Other.PrimaryWeapon = WepID;
  940. Client.Other.CurrentWeapon = WepID;
  941. Client.Ammo.PrimaryAmmoClip = 80;
  942. Points[Client.XUID] = ((int)Points[Client.XUID]) - barrettCost2;
  943. }
  944.  
  945. return ChatType.ChatNone;
  946. }
  947. if (Message == "!42")
  948. {
  949. int rsassCost2 = Convert.ToInt32(rsassCost);
  950. if ((int)Points[Client.XUID] < rsassCost2)
  951. {
  952. iPrintLnBold("^1Не хватает очков!", Client);
  953. }
  954. else
  955. {
  956. int WepID = GetWeapon("iw5_rsass_mp_rsassscope");
  957. Client.Other.PrimaryWeaponAkimbo = false;
  958. Client.Other.SecondaryWeaponAkimbo = false;
  959. Client.Other.PrimaryWeapon = WepID;
  960. Client.Other.CurrentWeapon = WepID;
  961. Client.Ammo.PrimaryAmmoClip = 80;
  962. Points[Client.XUID] = ((int)Points[Client.XUID]) - rsassCost2;
  963. }
  964.  
  965. return ChatType.ChatNone;
  966. }
  967. if (Message == "!44")
  968. {
  969. int msrCost2 = Convert.ToInt32(msrCost);
  970. if ((int)Points[Client.XUID] < msrCost2)
  971. {
  972. iPrintLnBold("^1Не хватает очков!", Client);
  973. }
  974. else
  975. {
  976. int WepID = GetWeapon("iw5_msr_mp_msr_scope");
  977. Client.Other.PrimaryWeaponAkimbo = false;
  978. Client.Other.SecondaryWeaponAkimbo = false;
  979. Client.Other.PrimaryWeapon = WepID;
  980. Client.Other.CurrentWeapon = WepID;
  981. Client.Ammo.PrimaryAmmoClip = 80;
  982. Points[Client.XUID] = ((int)Points[Client.XUID]) - msrCost2;
  983. }
  984.  
  985. return ChatType.ChatNone;
  986. }
  987. if (Message == "!43")
  988. {
  989. int dragCost2 = Convert.ToInt32(dragCost);
  990. if ((int)Points[Client.XUID] < dragCost2)
  991. {
  992. iPrintLnBold("^1Не хватает очков!", Client);
  993. }
  994. else
  995. {
  996. int WepID = GetWeapon("iw5_dragunov_mp_dragunovscope");
  997. Client.Other.PrimaryWeaponAkimbo = false;
  998. Client.Other.SecondaryWeaponAkimbo = false;
  999. Client.Other.PrimaryWeapon = WepID;
  1000. Client.Other.CurrentWeapon = WepID;
  1001. Client.Ammo.PrimaryAmmoClip = 80;
  1002. Points[Client.XUID] = ((int)Points[Client.XUID]) - dragCost2;
  1003. }
  1004.  
  1005. return ChatType.ChatNone;
  1006. }
  1007. if (Message == "!45")
  1008. {
  1009. int l96a1Cost2 = Convert.ToInt32(l96a1Cost);
  1010. if ((int)Points[Client.XUID] < l96a1Cost2)
  1011. {
  1012. iPrintLnBold("^1Не хватает очков!", Client);
  1013. }
  1014. else
  1015. {
  1016. int WepID = GetWeapon("iw5_l96a1_mp_l96a1scope");
  1017. Client.Other.PrimaryWeaponAkimbo = false;
  1018. Client.Other.SecondaryWeaponAkimbo = false;
  1019. Client.Other.PrimaryWeapon = WepID;
  1020. Client.Other.CurrentWeapon = WepID;
  1021. Client.Ammo.PrimaryAmmoClip = 80;
  1022. Points[Client.XUID] = ((int)Points[Client.XUID]) - l96a1Cost2;
  1023. }
  1024.  
  1025. return ChatType.ChatNone;
  1026. }
  1027. if (Message == "!46")
  1028. {
  1029. int as50Cost2 = Convert.ToInt32(as50Cost);
  1030. if ((int)Points[Client.XUID] < as50Cost2)
  1031. {
  1032. iPrintLnBold("^1Не хватает очков!", Client);
  1033. }
  1034. else
  1035. {
  1036. int WepID = GetWeapon("iw5_as50_mp_as50scope");
  1037. Client.Other.PrimaryWeaponAkimbo = false;
  1038. Client.Other.SecondaryWeaponAkimbo = false;
  1039. Client.Other.PrimaryWeapon = WepID;
  1040. Client.Other.CurrentWeapon = WepID;
  1041. Client.Ammo.PrimaryAmmoClip = 80;
  1042. Points[Client.XUID] = ((int)Points[Client.XUID]) - as50Cost2;
  1043. }
  1044.  
  1045. return ChatType.ChatNone;
  1046. }
  1047.  
  1048. //shotguns
  1049. if (Message == "!51")
  1050. {
  1051. int modelCost2 = Convert.ToInt32(modelCost);
  1052. if ((int)Points[Client.XUID] < modelCost2)
  1053. {
  1054. iPrintLnBold("^1Не хватает очков!", Client);
  1055. }
  1056. else
  1057. {
  1058. int WepID = GetWeapon("iw5_1887_mp");
  1059. Client.Other.PrimaryWeaponAkimbo = false;
  1060. Client.Other.SecondaryWeaponAkimbo = false;
  1061. Client.Other.PrimaryWeapon = WepID;
  1062. Client.Other.CurrentWeapon = WepID;
  1063. Client.Ammo.PrimaryAmmoClip = 100;
  1064. Points[Client.XUID] = ((int)Points[Client.XUID]) - modelCost2;
  1065. }
  1066.  
  1067. return ChatType.ChatNone;
  1068. }
  1069. if (Message == "!52")
  1070. {
  1071. int strikerCost2 = Convert.ToInt32(strikerCost);
  1072. if ((int)Points[Client.XUID] < strikerCost2)
  1073. {
  1074. iPrintLnBold("^1Не хватает очков!", Client);
  1075. }
  1076. else
  1077. {
  1078. int WepID = GetWeapon("iw5_striker_mp");
  1079. Client.Other.PrimaryWeaponAkimbo = false;
  1080. Client.Other.SecondaryWeaponAkimbo = false;
  1081. Client.Other.PrimaryWeapon = WepID;
  1082. Client.Other.CurrentWeapon = WepID;
  1083. Client.Ammo.PrimaryAmmoClip = 100;
  1084. Points[Client.XUID] = ((int)Points[Client.XUID]) - strikerCost2;
  1085. }
  1086.  
  1087. return ChatType.ChatNone;
  1088. }
  1089. if (Message == "!53")
  1090. {
  1091. int aa12Cost2 = Convert.ToInt32(aa12Cost);
  1092. if ((int)Points[Client.XUID] < aa12Cost2)
  1093. {
  1094. iPrintLnBold("^1Не хватает очков!", Client);
  1095. }
  1096. else
  1097. {
  1098. int WepID = GetWeapon("iw5_aa12_mp");
  1099. Client.Other.PrimaryWeaponAkimbo = false;
  1100. Client.Other.SecondaryWeaponAkimbo = false;
  1101. Client.Other.PrimaryWeapon = WepID;
  1102. Client.Other.CurrentWeapon = WepID;
  1103. Client.Ammo.PrimaryAmmoClip = 100;
  1104. Points[Client.XUID] = ((int)Points[Client.XUID]) - aa12Cost2;
  1105. }
  1106.  
  1107. return ChatType.ChatNone;
  1108. }
  1109.  
  1110. if (Message == "!54")
  1111. {
  1112. int usasCost2 = Convert.ToInt32(usasCost);
  1113. if ((int)Points[Client.XUID] < usasCost2)
  1114. {
  1115. iPrintLnBold("^1Не хватает очков!", Client);
  1116. }
  1117. else
  1118. {
  1119. int WepID = GetWeapon("iw5_usas12_mp");
  1120. Client.Other.PrimaryWeaponAkimbo = false;
  1121. Client.Other.SecondaryWeaponAkimbo = false;
  1122. Client.Other.PrimaryWeapon = WepID;
  1123. Client.Other.CurrentWeapon = WepID;
  1124. Client.Ammo.PrimaryAmmoClip = 100;
  1125. Points[Client.XUID] = ((int)Points[Client.XUID]) - usasCost2;
  1126. }
  1127.  
  1128. return ChatType.ChatNone;
  1129. }
  1130.  
  1131.  
  1132. if (Message == "!55")
  1133. {
  1134. int spasCost2 = Convert.ToInt32(spasCost);
  1135. if ((int)Points[Client.XUID] < spasCost2)
  1136. {
  1137. iPrintLnBold("^1Не хватает очков!", Client);
  1138. }
  1139. else
  1140. {
  1141. int WepID = GetWeapon("iw5_spas12_mp");
  1142. Client.Other.PrimaryWeaponAkimbo = false;
  1143. Client.Other.SecondaryWeaponAkimbo = false;
  1144. Client.Other.PrimaryWeapon = WepID;
  1145. Client.Other.CurrentWeapon = WepID;
  1146. Client.Ammo.PrimaryAmmoClip = 100;
  1147. Points[Client.XUID] = ((int)Points[Client.XUID]) - spasCost2;
  1148. }
  1149.  
  1150. return ChatType.ChatNone;
  1151. }
  1152.  
  1153. //explosives
  1154. if (Message == "!61")
  1155. {
  1156. int rpgCost2 = Convert.ToInt32(rpgCost);
  1157. if ((int)Points[Client.XUID] < rpgCost2)
  1158. {
  1159. iPrintLnBold("^1Не хватает очков!", Client);
  1160. }
  1161. else
  1162. {
  1163. int WepID = GetWeapon("rpg_mp");
  1164. Client.Other.PrimaryWeaponAkimbo = false;
  1165. Client.Other.SecondaryWeaponAkimbo = false;
  1166. Client.Other.PrimaryWeapon = WepID;
  1167. Client.Other.CurrentWeapon = WepID;
  1168. Client.Ammo.PrimaryAmmoClip = 10;
  1169. Points[Client.XUID] = ((int)Points[Client.XUID]) - rpgCost2;
  1170. }
  1171.  
  1172. return ChatType.ChatNone;
  1173. }
  1174. if (Message == "!62")
  1175. {
  1176. int xm25Cost2 = Convert.ToInt32(xm25Cost);
  1177. if ((int)Points[Client.XUID] < xm25Cost2)
  1178. {
  1179. iPrintLnBold("^1Не хватает очков!", Client);
  1180. }
  1181. else
  1182. {
  1183. int WepID = GetWeapon("xm25_mp");
  1184. Client.Other.PrimaryWeaponAkimbo = false;
  1185. Client.Other.SecondaryWeaponAkimbo = false;
  1186. Client.Other.PrimaryWeapon = WepID;
  1187. Client.Other.CurrentWeapon = WepID;
  1188. Client.Ammo.PrimaryAmmoClip = 50;
  1189. Points[Client.XUID] = ((int)Points[Client.XUID]) - xm25Cost2;
  1190. }
  1191.  
  1192.  
  1193. return ChatType.ChatNone;
  1194. }
  1195.  
  1196. if (Message == "!fm")
  1197. {
  1198. int FMCost2 = Convert.ToInt32(FMCost);
  1199. if ((int)Points[Client.XUID] < FMCost2)
  1200. {
  1201. iPrintLnBold("^1Не хватает очков!", Client);
  1202. }
  1203. else
  1204. {
  1205. Client.Other.SetPerk(GetPerk("specialty_fastermelee"));
  1206. Points[Client.XUID] = ((int)Points[Client.XUID]) - FMCost2;
  1207. }
  1208.  
  1209. return ChatType.ChatNone;
  1210. }
  1211. if (Message == "!fl")
  1212. {
  1213.  
  1214. int FRCost2 = Convert.ToInt32(FRCost);
  1215. if ((int)Points[Client.XUID] < FRCost2)
  1216. {
  1217. iPrintLnBold("^1Не хватает очков!", Client);
  1218. }
  1219. else
  1220. {
  1221. Client.Other.SetPerk(GetPerk("specialty_fastreload"));
  1222. Points[Client.XUID] = ((int)Points[Client.XUID]) - FRCost2;
  1223. }
  1224.  
  1225. return ChatType.ChatNone;
  1226. }
  1227.  
  1228. if (Message == "!be")
  1229. {
  1230.  
  1231. int BECost2 = Convert.ToInt32(BECost);
  1232. if ((int)Points[Client.XUID] < BECost2)
  1233. {
  1234. iPrintLnBold("^1Не хватает очков!", Client);
  1235. }
  1236. else
  1237. {
  1238. Client.Other.SetPerk(GetPerk("specialty_blindeye"));
  1239. Points[Client.XUID] = ((int)Points[Client.XUID]) - BECost2;
  1240. }
  1241.  
  1242. return ChatType.ChatNone;
  1243. }
  1244. if (Message == "!cb")
  1245. {
  1246.  
  1247. int CBCost2 = Convert.ToInt32(CBCost);
  1248. if ((int)Points[Client.XUID] < CBCost2)
  1249. {
  1250. iPrintLnBold("^1Не хватает очков!", Client);
  1251. }
  1252. else
  1253. {
  1254. Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
  1255. Points[Client.XUID] = ((int)Points[Client.XUID]) - CBCost2;
  1256. }
  1257.  
  1258. return ChatType.ChatNone;
  1259. }
  1260. if (Message == "!ba")
  1261. {
  1262.  
  1263. int BACost2 = Convert.ToInt32(BACost);
  1264. if ((int)Points[Client.XUID] < BACost2)
  1265. {
  1266. iPrintLnBold("^1Не хватает очков!", Client);
  1267. }
  1268. else
  1269. {
  1270. Client.Other.SetPerk(GetPerk("specialty_bulletaccuracy"));
  1271. Points[Client.XUID] = ((int)Points[Client.XUID]) - BACost2;
  1272. }
  1273.  
  1274. return ChatType.ChatNone;
  1275. }
  1276. if (Message == "!s")
  1277. {
  1278.  
  1279. int StalkerCost2 = Convert.ToInt32(StalkerCost);
  1280. if ((int)Points[Client.XUID] < StalkerCost2)
  1281. {
  1282. iPrintLnBold("^1Не хватает очков!", Client);
  1283. }
  1284. else
  1285. {
  1286. Client.Other.SetPerk(GetPerk("specialty_stalker"));
  1287. Points[Client.XUID] = ((int)Points[Client.XUID]) - StalkerCost2;
  1288. }
  1289.  
  1290. return ChatType.ChatNone;
  1291. }
  1292.  
  1293. }
  1294.  
  1295. if (Client.Team == Teams.Axis)
  1296. {
  1297.  
  1298. if (Message == "!60")
  1299. {
  1300. int bron_zCost2 = Convert.ToInt32(bron_zCost);
  1301. if ((int)Points[Client.XUID] < bron_zCost2)
  1302. {
  1303. iPrintLnBold("^1Не хватает очков!", Client);
  1304. }
  1305. else
  1306. {
  1307. iPrintLnBold("^2Куплена броня!", Client);
  1308. Client.Other.MaxHealth = 2500;
  1309. Client.Other.Health = 2500;
  1310. }
  1311. return ChatType.ChatNone;
  1312. }
  1313. if (Message == "!ammo")
  1314. {
  1315. int ammo_zCost2 = Convert.ToInt32(ammo_zCost);
  1316. if ((int)Points[Client.XUID] < ammo_zCost2)
  1317. {
  1318. iPrintLnBold("^1Не хватает очков!", Client);
  1319. }
  1320. else
  1321. {
  1322. int WepID = GetWeapon("iw5_p99_mp");
  1323. Client.Other.PrimaryWeapon = WepID;
  1324. Client.Other.CurrentWeapon = WepID;
  1325. Client.Ammo.PrimaryAmmoClip = 12;
  1326. Client.Ammo.SecondaryAmmoClip = 12;
  1327. Points[Client.XUID] = ((int)Points[Client.XUID]) - ammo_zCost2;
  1328. }
  1329. }
  1330. if (Message == "!emp")
  1331. {
  1332. int EmpGrenadeCost2 = Convert.ToInt32(EmpGrenadeCost);
  1333.  
  1334.  
  1335. if ((int)Points[Client.XUID] < EmpGrenadeCost2)
  1336. {
  1337. iPrintLnBold("^1Не хватает очков!", Client);
  1338. }
  1339. else
  1340. {
  1341.  
  1342. int WepID = GetWeapon("emp_grenade_mp");
  1343. Client.Other.OffhandWeapon = WepID;
  1344. Client.Ammo.OffhandAmmo = 2;
  1345. Points[Client.XUID] = ((int)Points[Client.XUID]) - EmpGrenadeCost2;
  1346. }
  1347. return ChatType.ChatNone;
  1348.  
  1349. }
  1350.  
  1351. if (Message == "!9")
  1352. {
  1353. int cxCost2 = Convert.ToInt32(cxCost);
  1354.  
  1355. if ((int)Points[Client.XUID] < cxCost2)
  1356. {
  1357. iPrintLnBold("^1Не хватает очков!", Client);
  1358. }
  1359. else
  1360. {
  1361. int WepID = GetWeapon("semtex_mp");
  1362. Client.Other.Equipment = WepID;
  1363. Client.Ammo.EquipmentAmmo = 1;
  1364. Points[Client.XUID] = ((int)Points[Client.XUID]) - cxCost2;
  1365. }
  1366. return ChatType.ChatNone;
  1367. }
  1368.  
  1369. if (Message == "!tk")
  1370. {
  1371.  
  1372. int TKCost2 = Convert.ToInt32(TKCost);
  1373.  
  1374. if ((int)Points[Client.XUID] < TKCost2)
  1375. {
  1376. iPrintLnBold("^1Не хватает очков!", Client);
  1377. }
  1378. else
  1379. {
  1380. int WepID = GetWeapon("throwingknife_mp");
  1381. Client.Other.Equipment = WepID;
  1382. Client.Ammo.EquipmentAmmo = 1;
  1383. Client.Other.OffhandType = EquipementTypes.ThrowingKnife;
  1384. Points[Client.XUID] = ((int)Points[Client.XUID]) - TKCost2;
  1385. }
  1386. return ChatType.ChatNone;
  1387. }
  1388. if (Message == "!cb")
  1389. {
  1390.  
  1391. int CB_ZCost2 = Convert.ToInt32(CB_ZCost);
  1392. if ((int)Points[Client.XUID] < CB_ZCost2)
  1393. {
  1394. iPrintLnBold("^1Не хватает очков!", Client);
  1395. }
  1396. else
  1397. {
  1398. Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
  1399. Points[Client.XUID] = ((int)Points[Client.XUID]) - CB_ZCost2;
  1400. }
  1401.  
  1402. return ChatType.ChatNone;
  1403. }
  1404. if (Message == "!s")
  1405. {
  1406. int Stalker_ZCost2 = Convert.ToInt32(Stalker_ZCost);
  1407. if ((int)Points[Client.XUID] < Stalker_ZCost2)
  1408. {
  1409. iPrintLnBold("^1Не хватает очков!", Client);
  1410. }
  1411. else
  1412. {
  1413. Client.Other.SetPerk(GetPerk("specialty_stalker"));
  1414. Points[Client.XUID] = ((int)Points[Client.XUID]) - Stalker_ZCost2;
  1415. }
  1416. return ChatType.ChatNone;
  1417. }
  1418.  
  1419. }
  1420. }
  1421. catch { }
  1422. return ChatType.ChatContinue;
  1423. }
  1424.  
  1425.  
  1426. public override string OnCheckBan(string xuid)
  1427. {
  1428. return null;
  1429. }
  1430.  
  1431. public override void OnMapChange()
  1432. {
  1433. }
  1434.  
  1435. public override void OnFastRestart()
  1436. {
  1437. }
  1438.  
  1439.  
  1440. void unrealTournament(ServerClient client)
  1441. {
  1442. if (client.Stats.Kills == 100)
  1443. {
  1444. iPrintLn(client.Name + " набил уже ^3 100 килов!", null);
  1445. iPrintLnBold(client.Name + " набил уже ^3 100 килов!", null);
  1446. }
  1447. }
  1448.  
  1449. private void AddKey(string XUID)
  1450. {
  1451. MySqlCommand comand = connection.CreateCommand();
  1452. comand.CommandText = "CREATE TABLE IF NOT EXISTS Points ( Point INT,XUID VARCHAR(255))";
  1453. comand.ExecuteNonQuery();
  1454. comand = connection.CreateCommand();
  1455. comand.CommandText = string.Format("select * from Points WHERE XUID = '{0}'", XUID);
  1456. MySqlDataReader Reader = comand.ExecuteReader();
  1457. string thisrow = "";
  1458. while (Reader.Read())
  1459. {
  1460. for (int i = 0; i < Reader.FieldCount; i++)
  1461. thisrow += Reader.GetValue(i).ToString();
  1462. }
  1463. if (string.IsNullOrEmpty(thisrow))
  1464. {
  1465. Points.Add(XUID, 0);
  1466. comand = connection.CreateCommand();
  1467. comand.CommandText = string.Format("INSERT INTO Points VALUES()");
  1468. comand.ExecuteNonQuery();
  1469. }
  1470. else
  1471. {
  1472. comand = connection.CreateCommand();
  1473. comand.CommandText = string.Format("select `Point` from Points WHERE XUID = '{0}'", XUID);
  1474. MySqlDataReader Reader1 = comand.ExecuteReader();
  1475. string thisrow1 = "";
  1476. while (Reader1.Read())
  1477. {
  1478. for (int i = 0; i < Reader1.FieldCount; i++)
  1479. thisrow1 += Reader1.GetValue(i).ToString();
  1480. }
  1481. Points.Add(XUID, int.Parse(thisrow1));
  1482. Reader1.Close();
  1483. }
  1484. Reader.Close();
  1485.  
  1486.  
  1487. }
  1488. public override void OnPlayerSpawned(ServerClient Client)
  1489. {
  1490. iPrintLnBold("^2Ведите ^1!shop^2 чтобы увидеть что можно купить за очки.", Client);
  1491. if (Points[Client.XUID] == null) {AddKey(Client.XUID); }
  1492. string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
  1493. if (clear_perks_onspawn == "true")
  1494. {
  1495. Client.Other.ClearPerks();
  1496. }
  1497. }
  1498.  
  1499.  
  1500.  
  1501. // <========== Cистема магазина ==========>
  1502. }
  1503. }
  1504. [/code]
  1505. UNTESTED should give the basic idea requires mysqladapter and http://observabledictionary.codeplex.com/
  1506. [code]
  1507. [Shop]
  1508. SERVER=localhost
  1509. //server of mysql
  1510. DB=b3_mw3
  1511. //databse name
  1512. USER=test1
  1513. //user
  1514. PASSWORD=test1
  1515. //password
  1516. [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement