Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
01-01-2013, 14:30
(This post was last modified: 01-01-2013, 14:37 by ltybcs.)
Hello.
I took the code from here: http://www.itsmods.com/forum/Thread-Rele...opers.html
Did everything as shown in the video here: http://www.itsmods.com/forum/Thread-How-...noobs.html
Code: using Addon;
using System;
using System.Collections.Generic;
namespace randomtext
{
public class randomtext : CPlugin
{
int Counter = -1;
public void RandomText()
{
Random rand = new Random();
switch (rand.Next(0, 4))
{
case 0:
rndtxt = " -! 1 ltybcs";
break;
case 1:
rndtxt = " ? ! !weapons";
break;
case 2:
rndtxt = " alt+f4 , ";
break;
case 3:
rndtxt = " %servername%. .";
break;
}
}
string rndtxt = string.Empty;
public override void OnMapChange()
{
Counter = 0;
RandomText();
}
private void CreateRndtext()
{
HudElem txt = CreateNewHudElem();
txt.Type = HudElementTypes.Text;
txt.ShowToEnt = Entity_World;
txt.HideInMenu = true;
txt.Font = HudElementFonts.Default;
txt.FontScale = 1.1f;
txt.PointType = 82;
txt.OriginY = 220f;
txt.OriginX = 700f;
txt.SetString(rndtxt);
}
public override void OnAddonFrame()
{
if (Counter >= 0)
{
Counter++;
if (Counter >= (1000 / AddonFrameInterval))
{
CreateRndtext();
Counter = -1;
}
}
}
}
}
The construction of solutions and displays an error when it writes that the build is successful and creates a plugin file.
1> ------ Build started: Project: randomtext, Configuration: Debug Any CPU ------
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3270: The disparity between the processor architecture of the project "MSIL", the construction of which is performed by the processor architecture and reference "addon "," x86 ". This discrepancy can lead to run-time errors. Try to change the target processor architecture for the project by using Configuration Manager to match processor architecture for the project, and links, or use the links from the dependence on the processor architecture, the appropriate target processor architecture project.
1> randomtext -> D: \ mw3server \ plugins \ randomtext.dll
========== Build: success: 1, error: 0, no change: 0, skipped: 0 ========== At server startup, the plugin does not work or just does not display the text.
I use Microsoft Visual Studio Express 2012.
Help the beginner, who than can, learn to make plugins for mw3
Advance sorry for my bad English, I from Russia and use Google translator
Posts: 284
Threads: 21
Joined: Jun 2012
Reputation:
13
(01-01-2013, 14:30)ltybcs Wrote:
The construction of solutions and displays an error when it writes that the build is successful and creates a plugin file.
[spoiler=Log building solutions:] 1> ------ Build started: Project: randomtext, Configuration: Debug Any CPU ------
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3270: The disparity between the processor architecture of the project "MSIL", the construction of which is performed by the processor architecture and reference "addon "," x86 ". This discrepancy can lead to run-time errors. Try to change the target processor architecture for the project by using Configuration Manager to match processor architecture for the project, and links, or use the links from the dependence on the processor architecture, the appropriate target processor architecture project.
1> randomtext -> D: \ mw3server \ plugins \ randomtext.dll
========== Build: success: 1, error: 0, no change: 0, skipped: 0 ==========
How about thinking about to read the compiler error message?
'-.-
Build for x86 or ON a x86
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
01-01-2013, 15:15
(This post was last modified: 01-01-2013, 16:20 by ltybcs.)
(01-01-2013, 15:08)Ich1994 Wrote: (01-01-2013, 14:30)ltybcs Wrote:
The construction of solutions and displays an error when it writes that the build is successful and creates a plugin file.
[spoiler=Log building solutions:] 1> ------ Build started: Project: randomtext, Configuration: Debug Any CPU ------
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3270: The disparity between the processor architecture of the project "MSIL", the construction of which is performed by the processor architecture and reference "addon "," x86 ". This discrepancy can lead to run-time errors. Try to change the target processor architecture for the project by using Configuration Manager to match processor architecture for the project, and links, or use the links from the dependence on the processor architecture, the appropriate target processor architecture project.
1> randomtext -> D: \ mw3server \ plugins \ randomtext.dll
========== Build: success: 1, error: 0, no change: 0, skipped: 0 ==========
How about thinking about to read the compiler error message?
'-.-
Build for x86 or ON a x86
In the Microsoft Visual Studio Express 2012 went to:
Building == Configuration Manager == Active solution platform == x86
Now the construction of solutions is normal:
1> ------ Rebuild All Files started: Project: randomtext, Configuration: Debug x86 ------
1> randomtext -> D:\mw3server\plugins\randomtext.dll
========== Rebuild All: success: 1, error: 0, skipped: 0 ==========
But the plugin still does not work or does not display text...
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
01-01-2013, 16:55
(This post was last modified: 01-01-2013, 16:58 by ltybcs.)
(01-01-2013, 16:45)SirGravzy Wrote: did you set the framework at 3.0 ?
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3267: Could not resolve the primary reference "System.Core", which is an assembly. NET Framework, in the target infrastructure. ". NETFramework, Version = v3.0". To fix this, remove the reference "System.Core", or change the target application infrastructure to the version that contains "System.Core".
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3268: could not resolve the primary link "System.Xml.Linq", since it is indirectly dependent on the assembly. NET Framework "System.Core, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089", which can not be resolved in the target infrastructure. ". NETFramework, Version = v3.0". To fix this problem, clear the "System.Xml.Linq", or change the target framework to version which contains "System.Core, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089".
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3268: could not resolve the primary link "System.Data.DataSetExtensions", since it is indirectly dependent on the assembly. NET Framework "System.Core, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089", which can not be resolved in the target infrastructure. ". NETFramework, Version = v3.0". To fix this problem, clear the "System.Data.DataSetExtensions", or change the target framework to version which contains "System.Core, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089".
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3267: Could not resolve the primary link "System.Xml.Linq", which is an assembly. NET Framework, the target infrastructure. ". NETFramework, Version = v3.0". To fix this problem, clear the "System.Xml.Linq", or change the target application infrastructure to the version that contains "System.Xml.Linq".
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3267: Could not resolve the primary link "System.Data.DataSetExtensions", which is an assembly. NET Framework, the target infrastructure. ". NETFramework, Version = v3.0". To fix this problem, clear the "System.Data.DataSetExtensions", or change the target application infrastructure to the version that contains "System.Data.DataSetExtensions".
1> C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (1578,5): warning MSB3267: Could not resolve the primary link "Microsoft.CSharp", which is an assembly. NET Framework, in the target infrastructure. ". NETFramework, Version = v3.0". To fix this problem, clear the "Microsoft.CSharp", or change the target application infrastructure to the version that contains "Microsoft.CSharp". BUT THE PLUGIN WORKS!
Thank you very much!
Posts: 76
Threads: 5
Joined: Sep 2012
Reputation:
2
01-01-2013, 23:44
(This post was last modified: 01-02-2013, 03:46 by yokai134.)
Remove all the Using X; that are from framework 4.0 as well as references that are for .Net 4.0
Where X is the assembly its referencing.
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
Hello.
It's me again.
This time I have a question about the plugin Shop system for Infected gametype .
Maybe this question has been asked a million times, is explained in different variations, but I did not find it on the forum.
How to make a SQL database, so that points are not reset every time you turn off the server?
Code: using Addon;
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections;
using System.IO;
namespace mw3shop
{
public class mw3shop : CPlugin
{
// SHITLOAD OF CODES
// PERKS
/*
* empgrenade
* tk
* fastmelee
* fastreload
* scavenger
* blindeye
* coldblood
* bulletacc
* stalker
* iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
* iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*
* iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
* iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
* iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
xm25
rpg
*/
Hashtable Points = new Hashtable();
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;
}
// Credits for MW3Console func - Jariz
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 (disable_tk == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
if (clear_perks_onspawn == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
}
}
Thread.Sleep(500);
}
}
// =============== //
public override void OnServerFrame()
{
}
public override void OnServerLoad()
{
ServerPrint("\n");
ServerPrint("<=== MW3===>");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] 'shop_sets' , - ");
ServerPrint("[*] JayDi, JariZ .");
ServerPrint("[*] ltybcs");
ServerPrint("[*] !");
ServerPrint("<=======================================>");
setup();
ThreadPool.QueueUserWorkItem(new WaitCallback(doConsole));
}
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", "200"); }
if (GetServerCFG("MW3SHOP", "EmpGrenadeCost", "") == "") { SetServerCFG("MW3SHOP", "EmpGrenadeCost", "200"); }
if (GetServerCFG("MW3SHOP", "clear_perks_onspawn", "") == "") { SetServerCFG("MW3SHOP", "clear_perks_onspawn", "false"); }
if (GetServerCFG("MW3SHOP", "claymoreCost", "") == "") { SetServerCFG("MW3SHOP", "claymoreCost", "420"); }
}
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 disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
string disable_tk = GetServerCFG("mw3shop", "disable_tk", "");
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);
}
if (Message == "!mypoints")
{
iPrintLnBold("^2 : " + points, Client);
}
if (Message == "!credits")
{
iPrintLnBold("^2 JayDi. ltybcs", Client);
}
if (Message == "!shop")
{
if (Client.Team == Teams.Allies)
{
TellClient(Client.ClientNum, "^1 !weapons | !perks ", true);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!emp ^2[" + EmpGrenadeCost + "]^1 ^7|^3!tk ^2[" + TKCost + "]^1-", Client);
}
return ChatType.ChatNone;
}
if (Message == "!weapons")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("!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", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^1 ", Client);
}
return ChatType.ChatNone;
}
if (Message == "!perks")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("^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-", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!cb^2[" + CB_ZCost + "]^1-^7|^3!s ^2[" + Stalker_ZCost + "]^1-^3", Client);
}
return ChatType.ChatNone;
}
// WEAPONS
if (Message == "!1")
{
/*
iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!2")
{
/*
iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!3")
{
/*
iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!4")
{
/*
iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!5")
{
/*
iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!6")
{
/*xm25*/
iPrintLnBold("^3!61^2[" + rpgCost + "]^1-RPG^7|^3!62^2[" + xm25Cost + "]^1-XM25^7|^3!65^2[" + claymoreCost + "]^1-", Client);
return ChatType.ChatNone;
}
// BUY SYSTEMS
if (Client.Team == Teams.Allies)
{
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;
}
// smgs
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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 == "!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 == "!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 = 2;
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()
{
}
public override void OnPlayerSpawned(ServerClient Client)
{
iPrintLnBold("^2 ^1!shop^2 .", Client);
if (Points[Client.XUID] == null) { Points.Add(Client.XUID, 0); }
string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
if (clear_perks_onspawn == "true")
{
Client.Other.ClearPerks();
}
}
// <========== SHOP SYSTEMS ==========>
}
}
Posts: 76
Threads: 5
Joined: Sep 2012
Reputation:
2
(01-02-2013, 10:19)ltybcs Wrote: Hello.
It's me again.
This time I have a question about the plugin Shop system for Infected gametype .
Maybe this question has been asked a million times, is explained in different variations, but I did not find it on the forum.
How to make a SQL database, so that points are not reset every time you turn off the server?
Code: using Addon;
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections;
using System.IO;
namespace mw3shop
{
public class mw3shop : CPlugin
{
// SHITLOAD OF CODES
// PERKS
/*
* empgrenade
* tk
* fastmelee
* fastreload
* scavenger
* blindeye
* coldblood
* bulletacc
* stalker
* iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
* iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*
* iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
* iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
* iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
xm25
rpg
*/
Hashtable Points = new Hashtable();
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;
}
// Credits for MW3Console func - Jariz
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 (disable_tk == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
if (clear_perks_onspawn == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
}
}
Thread.Sleep(500);
}
}
// =============== //
public override void OnServerFrame()
{
}
public override void OnServerLoad()
{
ServerPrint("\n");
ServerPrint("<=== MW3===>");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] 'shop_sets' , - ");
ServerPrint("[*] JayDi, JariZ .");
ServerPrint("[*] ltybcs");
ServerPrint("[*] !");
ServerPrint("<=======================================>");
setup();
ThreadPool.QueueUserWorkItem(new WaitCallback(doConsole));
}
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", "200"); }
if (GetServerCFG("MW3SHOP", "EmpGrenadeCost", "") == "") { SetServerCFG("MW3SHOP", "EmpGrenadeCost", "200"); }
if (GetServerCFG("MW3SHOP", "clear_perks_onspawn", "") == "") { SetServerCFG("MW3SHOP", "clear_perks_onspawn", "false"); }
if (GetServerCFG("MW3SHOP", "claymoreCost", "") == "") { SetServerCFG("MW3SHOP", "claymoreCost", "420"); }
}
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 disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
string disable_tk = GetServerCFG("mw3shop", "disable_tk", "");
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);
}
if (Message == "!mypoints")
{
iPrintLnBold("^2 : " + points, Client);
}
if (Message == "!credits")
{
iPrintLnBold("^2 JayDi. ltybcs", Client);
}
if (Message == "!shop")
{
if (Client.Team == Teams.Allies)
{
TellClient(Client.ClientNum, "^1 !weapons | !perks ", true);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!emp ^2[" + EmpGrenadeCost + "]^1 ^7|^3!tk ^2[" + TKCost + "]^1-", Client);
}
return ChatType.ChatNone;
}
if (Message == "!weapons")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("!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", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^1 ", Client);
}
return ChatType.ChatNone;
}
if (Message == "!perks")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("^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-", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!cb^2[" + CB_ZCost + "]^1-^7|^3!s ^2[" + Stalker_ZCost + "]^1-^3", Client);
}
return ChatType.ChatNone;
}
// WEAPONS
if (Message == "!1")
{
/*
iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!2")
{
/*
iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!3")
{
/*
iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!4")
{
/*
iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!5")
{
/*
iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!6")
{
/*xm25*/
iPrintLnBold("^3!61^2[" + rpgCost + "]^1-RPG^7|^3!62^2[" + xm25Cost + "]^1-XM25^7|^3!65^2[" + claymoreCost + "]^1-", Client);
return ChatType.ChatNone;
}
// BUY SYSTEMS
if (Client.Team == Teams.Allies)
{
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;
}
// smgs
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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 == "!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 == "!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 = 2;
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()
{
}
public override void OnPlayerSpawned(ServerClient Client)
{
iPrintLnBold("^2 ^1!shop^2 .", Client);
if (Points[Client.XUID] == null) { Points.Add(Client.XUID, 0); }
string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
if (clear_perks_onspawn == "true")
{
Client.Other.ClearPerks();
}
}
// <========== SHOP SYSTEMS ==========>
}
}
Do you mean changing that mod to use a MySQL database?
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
01-03-2013, 09:46
(This post was last modified: 01-03-2013, 10:20 by ltybcs.)
(01-03-2013, 04:53)yokai134 Wrote: Do you mean changing that mod to use a MySQL database?
I meant that I do not know how to create a SQL database that-be placed there is the number of points each player. But I have already solved this problem in another way, as described in this comment: http://www.itsmods.com/forum/Thread-Rele...0#pid93770
Code: using Addon;
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections;
using System.IO;
namespace mw3shop
{
public class mw3shop : CPlugin
{
// SHITLOAD OF CODES
// PERKS
/*
* empgrenade
* tk
* fastmelee
* fastreload
* scavenger
* blindeye
* coldblood
* bulletacc
* stalker
* iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
* iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*
* iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
* iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
* iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
xm25
rpg
*/
Hashtable Points = new Hashtable();
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);
StreamWriter writer = new StreamWriter("D:\\mw3server\\shop\\" + Attacker.XUID + ".txt");
int points = (int)Points[Attacker.XUID];
writer.WriteLine(Attacker.XUID + "=" + points.ToString());
writer.Dispose();
writer.Close();
}
catch (Exception z)
{
iPrintLn("[^1DEV^7]: " + z.Message, Attacker);
}
}
return Damage;
}
// Credits for MW3Console func - Jariz
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 (disable_tk == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
if (clear_perks_onspawn == "true")
{
ServerPrint(" ");
}
else
{
ServerPrint(" ");
}
}
}
Thread.Sleep(500);
}
}
// =============== //
public override void OnServerFrame()
{
}
public override void OnServerLoad()
{
ServerPrint("\n");
ServerPrint("<=== MW3===>");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] sv_config.ini");
ServerPrint("[*] 'shop_sets' , - ");
ServerPrint("[*] JayDi, JariZ .");
ServerPrint("[*] ltybcs");
ServerPrint("[*] !");
ServerPrint("<=======================================>");
setup();
ThreadPool.QueueUserWorkItem(new WaitCallback(doConsole));
}
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", "200"); }
if (GetServerCFG("MW3SHOP", "EmpGrenadeCost", "") == "") { SetServerCFG("MW3SHOP", "EmpGrenadeCost", "200"); }
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"); }
}
public override void OnPlayerConnect(ServerClient Client)
{
}
public override ChatType OnSay(string Message, ServerClient Client)
{
try
{
StreamReader reader = new StreamReader("D:\\mw3server\\shop\\" + Client.XUID + ".txt");
string read = reader.ReadLine();
string read2 = read;
string[] readArray = read2.Split('=');
Points[Client.XUID] = int.Parse(readArray[1]);
// 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 disable_perks = GetServerCFG("mw3shop", "disable_perks", "");
string disable_tk = GetServerCFG("mw3shop", "disable_tk", "");
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);
}
if (Message == "!mypoints")
{
iPrintLnBold("^2 : " + points, Client);
}
if (Message == "!credits")
{
iPrintLnBold("^2 JayDi. ltybcs", Client);
}
if (Message == "!shop")
{
if (Client.Team == Teams.Allies)
{
TellClient(Client.ClientNum, "^1 !weapons | !perks ", true);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!emp ^2[" + EmpGrenadeCost + "]^1 ^7|^3!tk ^2[" + TKCost + "]^1-", Client);
}
return ChatType.ChatNone;
}
if (Message == "!weapons")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("!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^7|^3!ak47a^7-^2 !", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^1 ", Client);
}
return ChatType.ChatNone;
}
if (Message == "!perks")
{
if (Client.Team == Teams.Allies)
{
iPrintLnBold("^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-", Client);
}
if (Client.Team == Teams.Axis)
{
iPrintLnBold("^3!cb^2[" + CB_ZCost + "]^1-^7|^3!s ^2[" + Stalker_ZCost + "]^1-^3", Client);
}
return ChatType.ChatNone;
}
// WEAPONS
if (Message == "!1")
{
/*
iw5_mp5
iw5_mp7
iw5_m9
iw5_p90
iw5_pp90m1
iw5_ump45
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!2")
{
/*
iw5_m60
iw5_mk46
iw5_pecheneg
iw5_sa80
iw5_mg36
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!3")
{
/*
iw5_m4
iw5_ak47
iw5_m16
iw5_fad
iw5_acr
iw5_mk14
iw5_scar
iw5_g36c
iw5_cm901
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!4")
{
/*
iw5_barrett
iw5_rsass
iw5_dragunov
iw5_msr
iw5_l96a1
iw5_as50
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!5")
{
/*
iw5_1887
iw5_striker
iw5_aa12
iw5_usas12
iw5_spas12
*/
iPrintLnBold("^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", Client);
return ChatType.ChatNone;
}
if (Message == "!6")
{
/*xm25*/
iPrintLnBold("^3!61^2[" + rpgCost + "]^1-RPG^7|^3!62^2[" + xm25Cost + "]^1-XM25^7|^3!65^2[" + claymoreCost + "]^1-", Client);
return ChatType.ChatNone;
}
// BUY SYSTEMS
if (Client.Team == Teams.Allies)
{
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;
}
// smgs
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
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 == "!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 == "!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 = 2;
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()
{
}
public override void OnPlayerSpawned(ServerClient Client)
{
iPrintLnBold("^2 ^1!shop^2 .", Client);
if (Points[Client.XUID] == null) { Points.Add(Client.XUID, 0); }
string clear_perks_onspawn = GetServerCFG("mw3shop", "clear_perks_onspawn", "");
if (clear_perks_onspawn == "true")
{
Client.Other.ClearPerks();
}
}
// <========== SHOP SYSTEMS ==========>
}
}
Now I have another problem, does anyone know the code to add to the store of arms akimbo, and that when you climbed the fence guns continued firing?
And is there anyone have the code of the plugin that automatically sends a command to (at (Do not know how to spell in English)) connect to the server or change the map, without the person who sent the command?
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
http://addon.teamsdk.com/
Check the Events
and there you have what you need :p
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
I read, but I didn't find there responses to a pregoing question.
ltybcs Wrote:Somebody knows a code of a plugin which automatically sends a command to a chat in case of connection of the player to the server and card change, without involvement of that whom the command goes?
Somebody can help me with it?
And can anyone write a code sample plugin adds sending traps to build different bins, paths, etc?
|