Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [code=CSHARP]
- using Addon;
- using System;
- using System.Text;
- using System.Runtime.InteropServices;
- using System.Threading;
- using System.Collections.Generic;
- using DigitalIdeaSolutions.Collections.Generic;
- using MySql.Data.MySqlClient;
- namespace mw3shop
- {
- public class mw3shop : CPlugin
- {
- MySqlConnection connection;
- ObservableDictionary<string, int> Points = new ObservableDictionary<string, int>();
- public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage)
- {
- if (Damage >= Victim.Other.Health && Attacker.Team != Victim.Team && Victim.XUID != Attacker.XUID)
- {
- try
- {
- Points[Attacker.XUID] = (((int)Points[Attacker.XUID]) + 100);
- iPrintLnBold("^5У тебя уже ^1" + (int)Points[Attacker.XUID] + "^5 очков", Attacker);
- }
- catch (Exception z)
- {
- iPrintLn("[^1DEV^7]: " + z.Message, Attacker);
- }
- }
- return Damage;
- }
- unsafe string MW3Console
- {
- get
- {
- IntPtr form = *(IntPtr*)0x5933A50;
- IntPtr txtbox = FindWindowEx(form, IntPtr.Zero, "Edit", null);
- IntPtr console = FindWindowEx(form, txtbox, "Edit", null);
- StringBuilder sb = new StringBuilder(9999999);
- int result = SendMessageTimeout(console, 0x0D, 9999999, sb, 10, 500, IntPtr.Zero);
- return sb.ToString();
- }
- }
- [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)]
- public static extern IntPtr FindWindow(string className, string windowName);
- [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
- public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
- [DllImport("User32.dll", SetLastError = true)]
- public static extern int SendMessageTimeout(
- IntPtr hWnd,
- uint uMsg,
- uint wParam,
- StringBuilder lParam,
- uint fuFlags,
- uint uTimeout,
- IntPtr lpdwResult);
- public void doConsole(object x)
- {
- string disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
- string disable_tk = GetServerCFG("mw3shop", "disable_tk", "");
- string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
- while (true)
- {
- string[] a = MW3Console.Split(new string[] { "\r\n" }, StringSplitOptions.None);
- int c = -1;
- foreach (string b in a)
- {
- c++;
- if (b == "]shop_sets" && c == a.Length - 2)
- {
- if (disable_perks == "false")
- {
- ServerPrint("Перки включены");
- }
- else
- {
- ServerPrint("Перки выключены");
- }
- if (clear_perks_onspawn == "true")
- {
- ServerPrint("Перки исчезают после спавна");
- }
- else
- {
- ServerPrint("Перки не исчезают после спавна");
- }
- }
- }
- Thread.Sleep(500);
- }
- }
- public override void OnServerFrame()
- {
- }
- public override void OnServerLoad()
- {
- 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)));
- connection.Open();
- ServerPrint("MySQL welcome by archit loaded!");
- ServerPrint("\n");
- ServerPrint("<===Магазин для MW3===>");
- ServerPrint("[*] Настроить цену можно открыв sv_config.ini");
- ServerPrint("[*] Включить или Отключить перки можно в sv_config.ini");
- ServerPrint("[*] Напиши 'shop_sets' здесь, что-бы увидеть настройки");
- ServerPrint("[*] Создал JayDi, Спасибо JariZ за помощь.");
- ServerPrint("[*] Перевёл ltybcs");
- ServerPrint("[*] Плагин загружен!");
- ServerPrint("<=======================================>");
- Points.KeyModified += Points_KeyModified;
- setup();
- ThreadPool.QueueUserWorkItem(new WaitCallback(doConsole));
- }
- void Points_KeyModified(object sender, KeyModifiedEventArgs<string, int> e)
- {
- MySqlCommand command = connection.CreateCommand();
- command.CommandText = "UPDATE Points SET Point=" + e.NewValue + " WHERE XUID='" + e.Key + "'";
- command.ExecuteNonQuery();
- }
- void setup()
- {
- if (GetServerCFG("MW3SHOP", "disable_perks", "") == "") { SetServerCFG("MW3SHOP", "disable_perks", "false"); }
- if (GetServerCFG("MW3SHOP", "disable_tk", "") == "") { SetServerCFG("MW3SHOP", "disable_tk", "false"); }
- if (GetServerCFG("MW3SHOP", "barrettCost", "") == "") { SetServerCFG("MW3SHOP", "barrettCost", "900"); }
- if (GetServerCFG("MW3SHOP", "ammoCost", "") == "") { SetServerCFG("MW3SHOP", "ammoCost", "100"); }
- if (GetServerCFG("MW3SHOP", "scarCost", "") == "") { SetServerCFG("MW3SHOP", "scarCost", "550"); }
- if (GetServerCFG("MW3SHOP", "mk14Cost", "") == "") { SetServerCFG("MW3SHOP", "mk14Cost", "650"); }
- if (GetServerCFG("MW3SHOP", "acrCost", "") == "") { SetServerCFG("MW3SHOP", "acrCost", "650"); }
- if (GetServerCFG("MW3SHOP", "fadCost", "") == "") { SetServerCFG("MW3SHOP", "fadCost", "700"); }
- if (GetServerCFG("MW3SHOP", "m16Cost", "") == "") { SetServerCFG("MW3SHOP", "m16Cost", "500"); }
- if (GetServerCFG("MW3SHOP", "ak47Cost", "") == "") { SetServerCFG("MW3SHOP", "ak47Cost", "760"); }
- if (GetServerCFG("MW3SHOP", "m4Cost", "") == "") { SetServerCFG("MW3SHOP", "m4Cost", "800"); }
- if (GetServerCFG("MW3SHOP", "mg36Cost", "") == "") { SetServerCFG("MW3SHOP", "mg36Cost", "850"); }
- if (GetServerCFG("MW3SHOP", "sa80Cost", "") == "") { SetServerCFG("MW3SHOP", "sa80Cost", "700"); }
- if (GetServerCFG("MW3SHOP", "cm901Cost", "") == "") { SetServerCFG("MW3SHOP", "cm901Cost", "650"); }
- if (GetServerCFG("MW3SHOP", "g36Cost", "") == "") { SetServerCFG("MW3SHOP", "g36Cost", "700"); }
- if (GetServerCFG("MW3SHOP", "rsassCost", "") == "") { SetServerCFG("MW3SHOP", "rsassCost", "750"); }
- if (GetServerCFG("MW3SHOP", "rpgCost", "") == "") { SetServerCFG("MW3SHOP", "rpgCost", "1010"); }
- if (GetServerCFG("MW3SHOP", "xm25Cost", "") == "") { SetServerCFG("MW3SHOP", "xm25Cost", "910"); }
- if (GetServerCFG("MW3SHOP", "spasCost", "") == "") { SetServerCFG("MW3SHOP", "spasCost", "510"); }
- if (GetServerCFG("MW3SHOP", "usasCost", "") == "") { SetServerCFG("MW3SHOP", "usasCost", "550"); }
- if (GetServerCFG("MW3SHOP", "aa12Cost", "") == "") { SetServerCFG("MW3SHOP", "aa12Cost", "650"); }
- if (GetServerCFG("MW3SHOP", "strikerCost", "") == "") { SetServerCFG("MW3SHOP", "strikerCost", "580"); }
- if (GetServerCFG("MW3SHOP", "modelCost", "") == "") { SetServerCFG("MW3SHOP", "modelCost", "700"); }
- if (GetServerCFG("MW3SHOP", "as50Cost", "") == "") { SetServerCFG("MW3SHOP", "as50Cost", "850"); }
- if (GetServerCFG("MW3SHOP", "l96a1Cost", "") == "") { SetServerCFG("MW3SHOP", "l96a1Cost", "950"); }
- if (GetServerCFG("MW3SHOP", "msrCost", "") == "") { SetServerCFG("MW3SHOP", "msrCost", "1100"); }
- if (GetServerCFG("MW3SHOP", "dragCost", "") == "") { SetServerCFG("MW3SHOP", "dragCost", "700"); }
- if (GetServerCFG("MW3SHOP", "pechCost", "") == "") { SetServerCFG("MW3SHOP", "pechCost", "900"); }
- if (GetServerCFG("MW3SHOP", "mk46Cost", "") == "") { SetServerCFG("MW3SHOP", "mk46Cost", "850"); }
- if (GetServerCFG("MW3SHOP", "m60Cost", "") == "") { SetServerCFG("MW3SHOP", "m60Cost", "990"); }
- if (GetServerCFG("MW3SHOP", "ump45Cost", "") == "") { SetServerCFG("MW3SHOP", "ump45Cost", "300"); }
- if (GetServerCFG("MW3SHOP", "pp90m1Cost", "") == "") { SetServerCFG("MW3SHOP", "pp90m1Cost", "450"); }
- if (GetServerCFG("MW3SHOP", "p90Cost", "") == "") { SetServerCFG("MW3SHOP", "p90Cost", "500"); }
- if (GetServerCFG("MW3SHOP", "m9Cost", "") == "") { SetServerCFG("MW3SHOP", "m9Cost", "400"); }
- if (GetServerCFG("MW3SHOP", "mp7Cost", "") == "") { SetServerCFG("MW3SHOP", "mp7Cost", "650"); }
- if (GetServerCFG("MW3SHOP", "mp5Cost", "") == "") { SetServerCFG("MW3SHOP", "mp5Cost", "500"); }
- if (GetServerCFG("MW3SHOP", "Stalker_ZCost", "") == "") { SetServerCFG("MW3SHOP", "Stalker_ZCost", "200"); }
- if (GetServerCFG("MW3SHOP", "CB_ZCost", "") == "") { SetServerCFG("MW3SHOP", "CB_ZCost", "250"); }
- if (GetServerCFG("MW3SHOP", "StalkerCost", "") == "") { SetServerCFG("MW3SHOP", "StalkerCost", "300"); }
- if (GetServerCFG("MW3SHOP", "BACost", "") == "") { SetServerCFG("MW3SHOP", "BACost", "400"); }
- if (GetServerCFG("MW3SHOP", "CBCost", "") == "") { SetServerCFG("MW3SHOP", "CBCost", "500"); }
- if (GetServerCFG("MW3SHOP", "BECost", "") == "") { SetServerCFG("MW3SHOP", "BECost", "300"); }
- if (GetServerCFG("MW3SHOP", "ScavengerCost", "") == "") { SetServerCFG("MW3SHOP", "ScavengerCost", "300"); }
- if (GetServerCFG("MW3SHOP", "FRCost", "") == "") { SetServerCFG("MW3SHOP", "FRCost", "500"); }
- if (GetServerCFG("MW3SHOP", "FMCost", "") == "") { SetServerCFG("MW3SHOP", "FMCost", "450"); }
- if (GetServerCFG("MW3SHOP", "TKCost", "") == "") { SetServerCFG("MW3SHOP", "TKCost", "1500"); }
- if (GetServerCFG("MW3SHOP", "EmpGrenadeCost", "") == "") { SetServerCFG("MW3SHOP", "EmpGrenadeCost", "50"); }
- if (GetServerCFG("MW3SHOP", "clear_perks_onspawn", "") == "") { SetServerCFG("MW3SHOP", "clear_perks_onspawn", "false"); }
- if (GetServerCFG("MW3SHOP", "claymoreCost", "") == "") { SetServerCFG("MW3SHOP", "claymoreCost", "420"); }
- if (GetServerCFG("MW3SHOP", "ak47aCost", "") == "") { SetServerCFG("MW3SHOP", "ak47aCost", "10000"); }
- if (GetServerCFG("MW3SHOP", "ammo_zCost", "") == "") { SetServerCFG("MW3SHOP", "ammo_zCost", "5000"); }
- if (GetServerCFG("MW3SHOP", "cxCost", "") == "") { SetServerCFG("MW3SHOP", "cxCost", "3000"); }
- if (GetServerCFG("MW3SHOP", "dCost", "") == "") { SetServerCFG("MW3SHOP", "dCost", "5000"); }
- if (GetServerCFG("MW3SHOP", "bronCost", "") == "") { SetServerCFG("MW3SHOP", "bronCost", "4000"); }
- if (GetServerCFG("MW3SHOP", "bron_zCost", "") == "") { SetServerCFG("MW3SHOP", "bron_zCost", "5000"); }
- if (GetServerCFG("MW3SHOP", "AC130_25mmCost", "") == "") { SetServerCFG("MW3SHOP", "AC130_25mmCost", "17500"); }
- }
- public override void OnPlayerConnect(ServerClient Client)
- {
- }
- public override ChatType OnSay(string Message, ServerClient Client)
- {
- try
- {
- // POINTS
- int points = (int)Points[Client.XUID];
- // SHOWS
- string EmpGrenadeCost = GetServerCFG("mw3shop", "EmpGrenadeCost", "");
- string TKCost = GetServerCFG("mw3shop", "TKCost", "");
- // PERKS
- string FMCost = GetServerCFG("mw3shop", "FMCost", "");
- string FRCost = GetServerCFG("mw3shop", "FRCost", "");
- string ScavengerCost = GetServerCFG("mw3shop", "ScavengerCost", "");
- string BECost = GetServerCFG("mw3shop", "BECost", "");
- string CBCost = GetServerCFG("mw3shop", "CBCost", "");
- string BACost = GetServerCFG("mw3shop", "BACost", "");
- string StalkerCost = GetServerCFG("mw3shop", "StalkerCost", "");
- string CB_ZCost = GetServerCFG("mw3shop", "CB_ZCost", "");
- string Stalker_ZCost = GetServerCFG("mw3shop", "Stalker_ZCost", "");
- // weapons
- string mp5Cost = GetServerCFG("mw3shop", "mp5Cost", "");
- string mp7Cost = GetServerCFG("mw3shop", "mp7Cost", "");
- string m9Cost = GetServerCFG("mw3shop", "m9Cost", "");
- string p90Cost = GetServerCFG("mw3shop", "p90Cost", "");
- string pp90m1Cost = GetServerCFG("mw3shop", "pp90m1Cost", "");
- string ump45Cost = GetServerCFG("mw3shop", "ump45Cost", "");
- string m60Cost = GetServerCFG("mw3shop", "m60Cost", "");
- string mk46Cost = GetServerCFG("mw3shop", "mk46Cost", "");
- string pechCost = GetServerCFG("mw3shop", "pechCost", "");
- string sa80Cost = GetServerCFG("mw3shop", "sa80Cost", "");
- string mg36Cost = GetServerCFG("mw3shop", "mg36Cost", "");
- string m4Cost = GetServerCFG("mw3shop", "m4Cost", "");
- string ak47Cost = GetServerCFG("mw3shop", "ak47Cost", "");
- string m16Cost = GetServerCFG("mw3shop", "m16Cost", "");
- string fadCost = GetServerCFG("mw3shop", "fadCost", "");
- string acrCost = GetServerCFG("mw3shop", "acrCost", "");
- string mk14Cost = GetServerCFG("mw3shop", "mk14Cost", "");
- string scarCost = GetServerCFG("mw3shop", "scarCost", "");
- string g36Cost = GetServerCFG("mw3shop", "g36Cost", "");
- string cm901Cost = GetServerCFG("mw3shop", "cm901Cost", "");
- string barrettCost = GetServerCFG("mw3shop", "barrettCost", "");
- string rsassCost = GetServerCFG("mw3shop", "rsassCost", "");
- string dragCost = GetServerCFG("mw3shop", "dragCost", "");
- string msrCost = GetServerCFG("mw3shop", "msrCost", "");
- string l96a1Cost = GetServerCFG("mw3shop", "l96a1Cost", "");
- string as50Cost = GetServerCFG("mw3shop", "as50Cost", "");
- string modelCost = GetServerCFG("mw3shop", "modelCost", "");
- string strikerCost = GetServerCFG("mw3shop", "strikerCost", "");
- string aa12Cost = GetServerCFG("mw3shop", "aa12Cost", "");
- string usasCost = GetServerCFG("mw3shop", "usasCost", "");
- string spasCost = GetServerCFG("mw3shop", "spasCost", "");
- string xm25Cost = GetServerCFG("mw3shop", "xm25Cost", "");
- string rpgCost = GetServerCFG("mw3shop", "rpgCost", "");
- string ammoCost = GetServerCFG("mw3shop", "ammoCost", "");
- string ZHPCost = GetServerCFG("mw3shop", "zHPCost", "");
- string claymoreCost = GetServerCFG("mw3shop", "claymoreCost", "");
- string ak47aCost = GetServerCFG("mw3shop", "ak47aCost", "");
- string ammo_zCost = GetServerCFG("mw3shop", "ammo_zCost", "");
- string cxCost = GetServerCFG("mw3shop", "cxCost", "");
- string dCost = GetServerCFG("mw3shop", "dCost", "");
- string bronCost = GetServerCFG("mw3shop", "bronCost", "");
- string bron_zCost = GetServerCFG("mw3shop", "bron_zCost", "");
- string AC130_25mmCost = GetServerCFG("mw3shop", "AC130_25mmCost", "");
- string disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
- if (Message == "!z_info")
- {
- iPrintLnBold("^2This is zombie survival. Collect points to upgrade yourself!", Client);
- return ChatType.ChatNone;
- }
- // SHOP
- if (Message == "!tut")
- {
- iPrintLnBold("^2Что-бы открыть магазин введите !shop.", Client);
- return ChatType.ChatNone;
- }
- if (Message == "!mypoints")
- {
- iPrintLnBold("^2Твои очки: " + points, Client);
- return ChatType.ChatNone;
- }
- if (Message == "!credits")
- {
- iPrintLnBold("^2Создатель JayDi. Перевод ltybcs", Client);
- return ChatType.ChatNone;
- }
- if (Message == "!shop")
- {
- if (Client.Team == Teams.Allies)
- {
- TellClient(Client.ClientNum, "^1Ведите !weapons чтобы посмотреть список оружия на покупку | Ведите !perks чтобы посмотреть какие перки можно купить", true);
- return ChatType.ChatNone;
- }
- if (Client.Team == Teams.Axis)
- {
- 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);
- return ChatType.ChatNone;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!weapons")
- {
- if (Client.Team == Teams.Allies)
- {
- 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);
- return ChatType.ChatNone;
- }
- if (Client.Team == Teams.Axis)
- {
- TellClient(Client.ClientNum, "^1Зомби не могут использовать эту команду", true);
- return ChatType.ChatNone;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!perks")
- {
- if (Client.Team == Teams.Allies)
- {
- 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);
- return ChatType.ChatNone;
- }
- if (Client.Team == Teams.Axis)
- {
- TellClient(Client.ClientNum, "^3!cb^2[" + CB_ZCost + "]^1-Убийца^7|^3!s ^2[" + Stalker_ZCost + "]^1-Сталкер^3", true);
- return ChatType.ChatNone;
- }
- return ChatType.ChatNone;
- }
- // WEAPONS
- if (Message == "!1")
- {
- /*
- iw5_mp5
- iw5_mp7
- iw5_m9
- iw5_p90
- iw5_pp90m1
- iw5_ump45
- */
- 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);
- return ChatType.ChatNone;
- }
- if (Message == "!2")
- {
- /*
- iw5_m60
- iw5_mk46
- iw5_pecheneg
- iw5_sa80
- iw5_mg36
- */
- 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);
- return ChatType.ChatNone;
- }
- if (Message == "!3")
- {
- /*
- iw5_m4
- iw5_ak47
- iw5_m16
- iw5_fad
- iw5_acr
- iw5_mk14
- iw5_scar
- iw5_g36c
- iw5_cm901
- */
- 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);
- return ChatType.ChatNone;
- }
- if (Message == "!4")
- {
- /*
- iw5_barrett
- iw5_rsass
- iw5_dragunov
- iw5_msr
- iw5_l96a1
- iw5_as50
- */
- 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);
- return ChatType.ChatNone;
- }
- if (Message == "!5")
- {
- /*
- iw5_1887
- iw5_striker
- iw5_aa12
- iw5_usas12
- iw5_spas12
- */
- 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);
- return ChatType.ChatNone;
- }
- if (Message == "!6")
- {
- /*xm25*/
- TellClient(Client.ClientNum, "^3!61^2[" + rpgCost + "]^1-RPG^7|^3!62^2[" + xm25Cost + "]^1-XM25^7|^3!65^2[" + claymoreCost + "]^1-Клеймор", true);
- return ChatType.ChatNone;
- }
- if (Message == "!7")
- {
- /*xm25*/
- 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);
- return ChatType.ChatNone;
- }
- // BUY SYSTEMS
- if (Client.Team == Teams.Allies)
- {
- if (Message == "!59")
- {
- int AC130_25mmCost2 = Convert.ToInt32(AC130_25mmCost);
- if ((int)Points[Client.XUID] < AC130_25mmCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("ac130_25mm_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Ammo.PrimaryAmmo = 9999;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - AC130_25mmCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!10")
- {
- int bronCost2 = Convert.ToInt32(bronCost);
- if ((int)Points[Client.XUID] < bronCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- iPrintLnBold("^2Куплена броня!", Client);
- Client.Other.Health = Client.Other.Health + 150;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!ammo")
- {
- int ammoCost2 = Convert.ToInt32(ammoCost);
- if ((int)Points[Client.XUID] < ammoCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- iPrintLnBold("^2Куплено 200 потронов!", Client);
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - ammoCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!ak47a")
- {
- int ak47aCost2 = Convert.ToInt32(ak47aCost);
- if ((int)Points[Client.XUID] < ak47aCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_ak47_mp");
- Client.Other.PrimaryWeaponAkimbo = true;
- Client.Other.PrimaryWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 1034;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - ak47aCost2;
- }
- return ChatType.ChatNone;
- }
- // smgs
- if (Message == "!8")
- {
- int dCost2 = Convert.ToInt32(dCost);
- if ((int)Points[Client.XUID] < dCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_deserteagle_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 50;
- Client.Ammo.PrimaryAmmo = 8;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - dCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!11")
- {
- int mp5Cost2 = Convert.ToInt32(mp5Cost);
- if ((int)Points[Client.XUID] < mp5Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_mp5_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - mp5Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!12")
- {
- int mp7Cost2 = Convert.ToInt32(mp7Cost);
- if ((int)Points[Client.XUID] < mp7Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_mp7_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - mp7Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!13")
- {
- int m9Cost2 = Convert.ToInt32(m9Cost);
- if ((int)Points[Client.XUID] < m9Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_m9_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - m9Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!14")
- {
- int p90Cost2 = Convert.ToInt32(p90Cost);
- if ((int)Points[Client.XUID] < p90Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_p90_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - p90Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!15")
- {
- int pp90m1Cost2 = Convert.ToInt32(pp90m1Cost);
- if ((int)Points[Client.XUID] < pp90m1Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_pp90m1_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - pp90m1Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!16")
- {
- int ump45Cost2 = Convert.ToInt32(ump45Cost);
- if ((int)Points[Client.XUID] < ump45Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_ump45_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - ump45Cost2;
- }
- return ChatType.ChatNone;
- }
- //lmgs
- if (Message == "!21")
- {
- int m60Cost2 = Convert.ToInt32(m60Cost);
- if ((int)Points[Client.XUID] < m60Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_m60_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 300;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - m60Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!22")
- {
- int mk46Cost2 = Convert.ToInt32(mk46Cost);
- if ((int)Points[Client.XUID] < mk46Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_mk46_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 300;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - mk46Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!23")
- {
- int pechCost2 = Convert.ToInt32(pechCost);
- if ((int)Points[Client.XUID] < pechCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_pecheneg_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 300;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - pechCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!24")
- {
- int sa80Cost2 = Convert.ToInt32(sa80Cost);
- if ((int)Points[Client.XUID] < sa80Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_sa80_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 300;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - sa80Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!25")
- {
- int mg36Cost2 = Convert.ToInt32(mg36Cost);
- if ((int)Points[Client.XUID] < mg36Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_mg36_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 300;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - mg36Cost2;
- }
- return ChatType.ChatNone;
- }
- // assaults
- if (Message == "!31")
- {
- int m4Cost2 = Convert.ToInt32(m4Cost);
- if ((int)Points[Client.XUID] < m4Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_m4_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - m4Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!32")
- {
- int ak47Cost2 = Convert.ToInt32(ak47Cost);
- if ((int)Points[Client.XUID] < ak47Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_ak47_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - ak47Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!33")
- {
- int m16Cost2 = Convert.ToInt32(m16Cost);
- if ((int)Points[Client.XUID] < m16Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_m16_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - m16Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!34")
- {
- int fadCost2 = Convert.ToInt32(fadCost);
- if ((int)Points[Client.XUID] < fadCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_fad_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - fadCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!35")
- {
- int acrCost2 = Convert.ToInt32(acrCost);
- if ((int)Points[Client.XUID] < acrCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_acr_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - acrCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!36")
- {
- int mk14Cost2 = Convert.ToInt32(mk14Cost);
- if ((int)Points[Client.XUID] < mk14Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_mk14_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - mk14Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!37")
- {
- int scarCost2 = Convert.ToInt32(scarCost);
- if ((int)Points[Client.XUID] < scarCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_scar_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - scarCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!38")
- {
- int g36Cost2 = Convert.ToInt32(g36Cost);
- if ((int)Points[Client.XUID] < g36Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_g36c_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - g36Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!39")
- {
- int cm901Cost2 = Convert.ToInt32(cm901Cost);
- if ((int)Points[Client.XUID] < cm901Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_cm901_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 200;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - cm901Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!65")
- {
- int cmCost2 = Convert.ToInt32(claymoreCost);
- if ((int)Points[Client.XUID] < cmCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("claymore_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.Equipment = WepID;
- Client.Ammo.EquipmentAmmo = 2;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - cmCost2;
- }
- return ChatType.ChatNone;
- }
- //snipers
- if (Message == "!41")
- {
- int barrettCost2 = Convert.ToInt32(barrettCost);
- if ((int)Points[Client.XUID] < barrettCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_barrett_mp_barrettscope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - barrettCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!42")
- {
- int rsassCost2 = Convert.ToInt32(rsassCost);
- if ((int)Points[Client.XUID] < rsassCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_rsass_mp_rsassscope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - rsassCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!44")
- {
- int msrCost2 = Convert.ToInt32(msrCost);
- if ((int)Points[Client.XUID] < msrCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_msr_mp_msr_scope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - msrCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!43")
- {
- int dragCost2 = Convert.ToInt32(dragCost);
- if ((int)Points[Client.XUID] < dragCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_dragunov_mp_dragunovscope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - dragCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!45")
- {
- int l96a1Cost2 = Convert.ToInt32(l96a1Cost);
- if ((int)Points[Client.XUID] < l96a1Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_l96a1_mp_l96a1scope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - l96a1Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!46")
- {
- int as50Cost2 = Convert.ToInt32(as50Cost);
- if ((int)Points[Client.XUID] < as50Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_as50_mp_as50scope");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 80;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - as50Cost2;
- }
- return ChatType.ChatNone;
- }
- //shotguns
- if (Message == "!51")
- {
- int modelCost2 = Convert.ToInt32(modelCost);
- if ((int)Points[Client.XUID] < modelCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_1887_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 100;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - modelCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!52")
- {
- int strikerCost2 = Convert.ToInt32(strikerCost);
- if ((int)Points[Client.XUID] < strikerCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_striker_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 100;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - strikerCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!53")
- {
- int aa12Cost2 = Convert.ToInt32(aa12Cost);
- if ((int)Points[Client.XUID] < aa12Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_aa12_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 100;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - aa12Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!54")
- {
- int usasCost2 = Convert.ToInt32(usasCost);
- if ((int)Points[Client.XUID] < usasCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_usas12_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 100;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - usasCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!55")
- {
- int spasCost2 = Convert.ToInt32(spasCost);
- if ((int)Points[Client.XUID] < spasCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_spas12_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 100;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - spasCost2;
- }
- return ChatType.ChatNone;
- }
- //explosives
- if (Message == "!61")
- {
- int rpgCost2 = Convert.ToInt32(rpgCost);
- if ((int)Points[Client.XUID] < rpgCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("rpg_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 10;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - rpgCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!62")
- {
- int xm25Cost2 = Convert.ToInt32(xm25Cost);
- if ((int)Points[Client.XUID] < xm25Cost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("xm25_mp");
- Client.Other.PrimaryWeaponAkimbo = false;
- Client.Other.SecondaryWeaponAkimbo = false;
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 50;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - xm25Cost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!fm")
- {
- int FMCost2 = Convert.ToInt32(FMCost);
- if ((int)Points[Client.XUID] < FMCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_fastermelee"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - FMCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!fl")
- {
- int FRCost2 = Convert.ToInt32(FRCost);
- if ((int)Points[Client.XUID] < FRCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_fastreload"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - FRCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!be")
- {
- int BECost2 = Convert.ToInt32(BECost);
- if ((int)Points[Client.XUID] < BECost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_blindeye"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - BECost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!cb")
- {
- int CBCost2 = Convert.ToInt32(CBCost);
- if ((int)Points[Client.XUID] < CBCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - CBCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!ba")
- {
- int BACost2 = Convert.ToInt32(BACost);
- if ((int)Points[Client.XUID] < BACost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_bulletaccuracy"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - BACost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!s")
- {
- int StalkerCost2 = Convert.ToInt32(StalkerCost);
- if ((int)Points[Client.XUID] < StalkerCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_stalker"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - StalkerCost2;
- }
- return ChatType.ChatNone;
- }
- }
- if (Client.Team == Teams.Axis)
- {
- if (Message == "!60")
- {
- int bron_zCost2 = Convert.ToInt32(bron_zCost);
- if ((int)Points[Client.XUID] < bron_zCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- iPrintLnBold("^2Куплена броня!", Client);
- Client.Other.MaxHealth = 2500;
- Client.Other.Health = 2500;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!ammo")
- {
- int ammo_zCost2 = Convert.ToInt32(ammo_zCost);
- if ((int)Points[Client.XUID] < ammo_zCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("iw5_p99_mp");
- Client.Other.PrimaryWeapon = WepID;
- Client.Other.CurrentWeapon = WepID;
- Client.Ammo.PrimaryAmmoClip = 12;
- Client.Ammo.SecondaryAmmoClip = 12;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - ammo_zCost2;
- }
- }
- if (Message == "!emp")
- {
- int EmpGrenadeCost2 = Convert.ToInt32(EmpGrenadeCost);
- if ((int)Points[Client.XUID] < EmpGrenadeCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("emp_grenade_mp");
- Client.Other.OffhandWeapon = WepID;
- Client.Ammo.OffhandAmmo = 2;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - EmpGrenadeCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!9")
- {
- int cxCost2 = Convert.ToInt32(cxCost);
- if ((int)Points[Client.XUID] < cxCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("semtex_mp");
- Client.Other.Equipment = WepID;
- Client.Ammo.EquipmentAmmo = 1;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - cxCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!tk")
- {
- int TKCost2 = Convert.ToInt32(TKCost);
- if ((int)Points[Client.XUID] < TKCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- int WepID = GetWeapon("throwingknife_mp");
- Client.Other.Equipment = WepID;
- Client.Ammo.EquipmentAmmo = 1;
- Client.Other.OffhandType = EquipementTypes.ThrowingKnife;
- Points[Client.XUID] = ((int)Points[Client.XUID]) - TKCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!cb")
- {
- int CB_ZCost2 = Convert.ToInt32(CB_ZCost);
- if ((int)Points[Client.XUID] < CB_ZCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - CB_ZCost2;
- }
- return ChatType.ChatNone;
- }
- if (Message == "!s")
- {
- int Stalker_ZCost2 = Convert.ToInt32(Stalker_ZCost);
- if ((int)Points[Client.XUID] < Stalker_ZCost2)
- {
- iPrintLnBold("^1Не хватает очков!", Client);
- }
- else
- {
- Client.Other.SetPerk(GetPerk("specialty_stalker"));
- Points[Client.XUID] = ((int)Points[Client.XUID]) - Stalker_ZCost2;
- }
- return ChatType.ChatNone;
- }
- }
- }
- catch { }
- return ChatType.ChatContinue;
- }
- public override string OnCheckBan(string xuid)
- {
- return null;
- }
- public override void OnMapChange()
- {
- }
- public override void OnFastRestart()
- {
- }
- void unrealTournament(ServerClient client)
- {
- if (client.Stats.Kills == 100)
- {
- iPrintLn(client.Name + " набил уже ^3 100 килов!", null);
- iPrintLnBold(client.Name + " набил уже ^3 100 килов!", null);
- }
- }
- private void AddKey(string XUID)
- {
- MySqlCommand comand = connection.CreateCommand();
- comand.CommandText = "CREATE TABLE IF NOT EXISTS Points ( Point INT,XUID VARCHAR(255))";
- comand.ExecuteNonQuery();
- comand = connection.CreateCommand();
- comand.CommandText = string.Format("select * from Points WHERE XUID = '{0}'", XUID);
- MySqlDataReader Reader = comand.ExecuteReader();
- string thisrow = "";
- while (Reader.Read())
- {
- for (int i = 0; i < Reader.FieldCount; i++)
- thisrow += Reader.GetValue(i).ToString();
- }
- if (string.IsNullOrEmpty(thisrow))
- {
- Points.Add(XUID, 0);
- comand = connection.CreateCommand();
- comand.CommandText = string.Format("INSERT INTO Points VALUES()");
- comand.ExecuteNonQuery();
- }
- else
- {
- comand = connection.CreateCommand();
- comand.CommandText = string.Format("select `Point` from Points WHERE XUID = '{0}'", XUID);
- MySqlDataReader Reader1 = comand.ExecuteReader();
- string thisrow1 = "";
- while (Reader1.Read())
- {
- for (int i = 0; i < Reader1.FieldCount; i++)
- thisrow1 += Reader1.GetValue(i).ToString();
- }
- Points.Add(XUID, int.Parse(thisrow1));
- Reader1.Close();
- }
- Reader.Close();
- }
- public override void OnPlayerSpawned(ServerClient Client)
- {
- iPrintLnBold("^2Ведите ^1!shop^2 чтобы увидеть что можно купить за очки.", Client);
- if (Points[Client.XUID] == null) {AddKey(Client.XUID); }
- string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
- if (clear_perks_onspawn == "true")
- {
- Client.Other.ClearPerks();
- }
- }
- // <========== Cистема магазина ==========>
- }
- }
- [/code]
- UNTESTED should give the basic idea requires mysqladapter and http://observabledictionary.codeplex.com/
- [code]
- [Shop]
- SERVER=localhost
- //server of mysql
- DB=b3_mw3
- //databse name
- USER=test1
- //user
- PASSWORD=test1
- //password
- [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement