Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
shop code
#11
(02-14-2013, 21:02)hillbilly Wrote:
(02-14-2013, 20:57)99IRock Wrote:
(02-14-2013, 20:46)hillbilly Wrote: Oh i see it uses Threading, i wont bother even trying, thanks anyway.

I have the plugin, just removed Threading stuff easy :p

nice, gonna share it?

Uhm well it's the code of Sailormoon, but I just removed all threading stuff.
I also removed the config, so I have a list of all strings, and you can edit it than but not in the config, so I recoded a bit, so you just need to change the prices in the code if you like :p.
(Also some messages are bugged)
You also might change paths for saving points with the database (Made by @8q4s8) and someone will response: Use the new shop, or Use the mysql database, well I didn't figure out how so I just use @8q4s8 's code thx @8q4s8 Big Grin )

You need to look to this lines :
(
Code:
StreamWriter writer = new StreamWriter("D:\\mw3server\\plugins\\ShopPlugin\\" + split[1] + ".txt");

And (OnPlayerConnect event)
Code:
StreamReader reader = new StreamReader("D:\\mw3server\\plugins\\ShopPlugin\\" + Client.XUID + ".txt");

And (OnPlayerDamage)
Code:
StreamWriter writer = new StreamWriter("D:\\mw3server\\plugins\\ShopPlugin\\" + Attacker.XUID + ".txt");


AND ALSO
Code:
public override void OnPlayerSpawned(ServerClient Client)
        {
            iPrintLnBold("^2Welcome to CraftBang, use !shop to see the shop", Client);
            if (Points[Client.XUID] == null) { Points.Add(Client.XUID, 0); }
        }

Edit the welcome message Wink

And
Code:
if (Message == "!info")
                {
                    iPrintLnBold("^2Welcome to CraftBang Infected! Kill people to receive points and use them in the shop!", Client);
                    return ChatType.ChatNone;
                }


Anyway @sailormoon thanks so much for the code.

MODIFIED CODE:
Code:
using Addon;
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Collections;
using System.Collections.Generic;
using System.IO;
namespace mw3shop
{
    public class mw3shop : CPlugin
    {
        // PERKS
        /*
         * empgrenade
         * tk
         * fastmelee
         * fastreload
         * scavenger
         * blindeye
         * coldblood
         * bulletacc
         * stalker
         * SMG
         * iw5_mp5
            iw5_mp7
            iw5_m9
            iw5_p90
            iw5_pp90m1
            iw5_ump45
         * LMG
         * iw5_m60
            iw5_mk46
            iw5_pecheneg
            iw5_sa80
            iw5_mg36
         * Assault
         * iw5_m4
            iw5_ak47
            iw5_m16
            iw5_fad
            iw5_acr
            iw5_mk14
            iw5_scar
            iw5_g36c
            iw5_cm901
         * Snipers
         *  iw5_barrett
            iw5_rsass
            iw5_dragunov
            iw5_msr
            iw5_l96a1
            iw5_as50
         * Shotguns
         *  iw5_1887
            iw5_striker
            iw5_aa12
            iw5_usas12
            iw5_spas12
         * Explosives
            xm25
            rpg
        */





        // Prices

        //KITS FOR SURVIVOR :OOOO
        string lightweightkit = "8765";
        string heavykit = "9001"; // ur back its magic ye I was sleeping next to my cat lol

        //SMG
        string mp5price = "400";
        string mp7price = "500";
        string m9price = "600";
        string p90price = "700";
        string pp90m1price = "800";
        string ump45price = "900";
        //LMG
        string m60price = "1000";
        string mk46price = "1100";
        string pechprice = "1200";
        string sa80price = "1300";
        string mg36price = "1400";
        // Assault
        string m4price = "1000";
        string ak47price = "1100";
        string m16price = "1200";
        string fadprice = "1300";
        string acrprice = "1400";
        string mk14price = "1500";
        string scarprice = "1600";
        string g36cprice = "1700";
        string cm901price = "1800";
        // Snipers
        string barretprice = "1000";
        string rsassprice = "1100";
        string dragunovprice = "1200";
        string msrprice = "1300";
        string l96a1price = "1400";
        string as50price = "1500";
        //Shotguns
        string modelprice = "1000"; // 1887
        string aa12price = "1100";
        string usas12price = "1200";
        string spas12price = "1300";
        string strikerprice = "1400";
        string ksgprice = "1400";

        //Explosives
        string rpgprice = "5000";
        string xm25price = "4000";
        string stingerprice = "4000";
        string smawprice = "4500";

        string empprice = "750";
        string claymorprice = "1000";
        string ammoprice = "1000";
        string shieldprice = "5000";
        string smokeprice = "1000";
        string flashprice = "1500";
        string tkprice = "2500";

        // PERKS
        string fm = "400"; //Fastermelee
        string fr = "500"; //Fastreload
        string sc = "600"; //Scavenger
        string be = "600"; // Blindeye
        string cb = "600"; // coldblood
        string ba = "700"; // Bulletacc
        string sk = "600"; //Stalker

      


        // -----------------------------------------------------------------------------------------
        // Points system (Database)
        // -----------------------------------------------------------------------------------------
        Hashtable Points = new Hashtable();

        public override void OnPlayerConnect(ServerClient Client)
        {
            try
            {
                StreamReader reader = new StreamReader("D:\\mw3server\\plugins\\ShopPlugin\\" + Client.XUID + ".txt");

                string read = reader.ReadLine();
                string read2 = read;

                string[] readArray = read2.Split('=');
                Points[Client.XUID] = int.Parse(readArray[1]);
            }
            catch
            {
            }
        }

        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\\plugins\\ShopPlugin\\" + Attacker.XUID + ".txt");

                    int points = (int)Points[Attacker.XUID];

                    writer.WriteLine(Attacker.XUID + "=" + points.ToString());
                    writer.Dispose();
                    writer.Close();
                }
                catch
                {
                }
            }
            return Damage;
        }

        // -----------------------------------------------------------------------------------------
        // 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);

        // -----------------------------------------------------------------------------------------
        // End consolefunc
        // -----------------------------------------------------------------------------------------

        public override void OnServerFrame()
        {

        }

        public override void OnServerLoad()
        {
            ServerPrint("99IRocks modified shop(Original from @Sailormoon) loaded");

        }

        public override ChatType OnSay(string Message, ServerClient Client)
        {  
            try
            {
              
                // -----------------------------------------------------------------------------------------
                // HelpChat
                // -----------------------------------------------------------------------------------------
                int points2 = (int)Points[Client.XUID]; // EDITED FROM points to points2

                if (Message == "!info")
                {
                    iPrintLnBold("^2Welcome to CraftBang Infected! Kill people to receive points and use them in the shop!", Client);
                    return ChatType.ChatNone;
                }

                if (Message == "!help")
                {
                    iPrintLnBold("^2Use !shop to see the shop!", Client);
                }
                if (Message == "!points" || Message == "!mypoints" || Message == "!point")
                {
                    iPrintLnBold("^2Your points: " + points2, Client);
                }



                if (Message == "!shop")
                {
                    if (Client.Team == Teams.Allies)
                    {
                        iPrintLnBold("^1!weapons^7 - ^3shows weapon list\n^1!perks^7 - ^3shows perk list/n^1!kits - shows kit list", Client);
                    }
                    if (Client.Team == Teams.Axis)
                    {
                        iPrintLnBold("^3!emp ^2[" + empprice + "] ^3!riot ^2[" + shieldprice + "]", Client);
                    }
                    return ChatType.ChatNone;
                }

                if (Message == "!weapons")
                {
                    if (Client.Team == Teams.Allies)
                    {
                        iPrintLnBold("!smg^7-^2SMGs^7|^3!lmg^7-^2LMGs^7|^3!assault^7-^2Assaults^7|^3!snipe^7-^2Snipers^7|^3!shotguns^7-^2Shotguns^7|^3!expl^7-^2Explosives", Client);
                    }
                    if (Client.Team == Teams.Axis)
                    {
                        iPrintLnBold("^1You can't use weapons as an infected!", Client);
                    }
                    return ChatType.ChatNone;
                }

                

                if (Message == "!perks")
                {

                    if (Client.Team == Teams.Allies)
                    {
                        iPrintLnBold("^3!fastermelee^2[" + fm + "]^7|^3!fastreload^2[" + fr + "]^7|^3!scavenger^2[" + sc + "]^7|^3n!blindeye^2[" + be + "]^7|^3!coldblood^2[" + cb + "]^7|^3!bulletaccuracy^2[" + ba + "]^7|^3!stalker^2[" + sk + "]", Client);

                    }
                    if (Client.Team == Teams.Axis)
                    {
                        iPrintLnBold("^1For infected:^7|^3!coldblood ^2[" + cb + "]^7|^3!stalker ^2[" + sk + "]^3", Client);
                    }

                    return ChatType.ChatNone;
                }

                // -----------------------------------------------------------------------------------------
                // WEAPONS
                // -----------------------------------------------------------------------------------------

                if (Message == "!smg")
                {
                    /*
                    iw5_mp5
                    iw5_mp7
                    iw5_m9
                    iw5_p90
                    iw5_pp90m1
                    iw5_ump45
                    */
                    iPrintLnBold("^3!mp5^2[" + mp5price + "]^7|^3!mp7^2[" + mp7price + "]^7|^3!pm9^2[" + m9price + "]^7|^3P90^2[" + p90price + "]^7|^3!pp90^2[" + pp90m1price + "]^7|^3!ump45^2[" + ump45price + "]", Client);
                    return ChatType.ChatNone;
                }
                if (Message == "!lmg")
                {
                    /*
                    iw5_m60
                    iw5_mk46
                    iw5_pecheneg
                    iw5_sa80
                    iw5_mg36
                    */
                    iPrintLnBold("^3!m60^2[" + m60price + "]^7|^3!mk46^2[" + mk46price + "]^7|^3!pech^2[" + pechprice + "]^7|^3!l86^2[" + sa80price + "]^7|^3!mg36^2[" + mg36price + "]", Client);
                    return ChatType.ChatNone;
                }
                if (Message == "!assault")
                {
                    /*
                    iw5_m4
                    iw5_ak47
                    iw5_m16
                    iw5_fad
                    iw5_acr
                    iw5_mk14
                    iw5_scar
                    iw5_g36c
                    iw5_cm901
                    */
                    iPrintLnBold("^3!m4^2[" + m4price + "]^7|^3!ak47^2[" + ak47price + "]^7|^3!m16^2[" + m16price + "]^7|^3!fad^2[" + fadprice + "]^7|^3!acr^2[" + acrprice + "]^7|^3!mk14^2[" + mk14price + "]^7|^3!scar^2[" + scarprice + "]^7|^3!g36^2[" + g36cprice + "]^7|^3!cm901^2[" + cm901price + "]", Client);
                    return ChatType.ChatNone;
                }

                if (Message == "!snipe")
                {
                    /*
                    iw5_barrett
                    iw5_rsass
                    iw5_dragunov
                    iw5_msr
                    iw5_l96a1
                    iw5_as50

                    */
                    iPrintLnBold("^3!barret^2[" + barretprice + "]^7|^3!rsass^2[" + rsassprice + "]^7|^3!dragunov^2[" + dragunovprice + "]^7|^3!msr^2[" + msrprice + "]^7|^3!l96a1^2[" + l96a1price + "]^7|^3!as50^2[" + as50price + "]", Client);
                    return ChatType.ChatNone;
                }

                if (Message == "!shotguns")
                {
                    /*
                    iw5_1887
                    iw5_striker
                    iw5_aa12
                    iw5_usas12
                    iw5_spas12
                    */
                    iPrintLnBold("^3!model^2[" + modelprice + "]^7|^3!striker^2[" + strikerprice + "]^7|^3!aa12^2[" + aa12price + "]^7|^3!usas12^2[" + usas12price + "]^7|^3!spas12^2[" + spas12price + "]", Client);
                    return ChatType.ChatNone;
                }
                if (Message == "!expl")
                {
                    /*xm25*/
                    iPrintLnBold("^3!rpg^2[" + rpgprice + "]^7|^3!xm25^2[" + xm25price + "]^7|^3!claymore^2[" + claymorprice + "]", Client);
                    return ChatType.ChatNone;
                }
                // BUY SYSTEMS
                if (Client.Team == Teams.Allies)
                {
                    if (Message == "!ammo")
                    {
                        int ammoprice2 = Convert.ToInt32(ammoprice);
                        if ((int)Points[Client.XUID] < ammoprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            iPrintLnBold("^2180 Ammo bullets bought!", Client);
                            Client.Ammo.PrimaryAmmoClip = 180;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - ammoprice2;
                        }
                        return ChatType.ChatNone;
                    }
                    // smgs
                    if (Message == "!mp5")
                    {
                        int mp5price2 = Convert.ToInt32(mp5price);
                        if ((int)Points[Client.XUID] < mp5price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_mp5_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - mp5price2;
                        }
                        return ChatType.ChatNone;
                    }
                    if (Message == "!mp7")
                    {

                        int mp7price2 = Convert.ToInt32(mp7price);
                        if ((int)Points[Client.XUID] < mp7price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_mp7_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - mp7price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!pm9")
                    {
                        int m9price2 = Convert.ToInt32(m9price);
                        if ((int)Points[Client.XUID] < m9price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_m9_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - m9price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!p90")
                    {
                        int p90price2 = Convert.ToInt32(p90price);
                        if ((int)Points[Client.XUID] < p90price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_p90_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - p90price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!pp90")
                    {
                        int pp90m1price2 = Convert.ToInt32(pp90m1price);
                        if ((int)Points[Client.XUID] < pp90m1price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_pp90m1_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - pp90m1price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!ump45")
                    {
                        int ump45price2 = Convert.ToInt32(ump45price);
                        if ((int)Points[Client.XUID] < ump45price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_ump45_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - ump45price2;
                        }

                        return ChatType.ChatNone;
                    }

                    //lmgs
                    if (Message == "!m60")
                    {
                        int m60price2 = Convert.ToInt32(m60price);
                        if ((int)Points[Client.XUID] < m60price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_m60_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - m60price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!mk46")
                    {
                        int mk46price2 = Convert.ToInt32(mk46price);
                        if ((int)Points[Client.XUID] < mk46price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_mk46_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - mk46price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!pech")
                    {
                        int pechprice2 = Convert.ToInt32(pechprice);
                        if ((int)Points[Client.XUID] < pechprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_pecheneg_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - pechprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!l86")
                    {
                        int sa80price2 = Convert.ToInt32(sa80price);
                        if ((int)Points[Client.XUID] < sa80price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_sa80_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - sa80price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!mg36")
                    {
                        int mg36price2 = Convert.ToInt32(mg36price);
                        if ((int)Points[Client.XUID] < mg36price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_mg36_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - mg36price2;
                        }

                        return ChatType.ChatNone;
                    }

                    // assaults
                    if (Message == "!m4")
                    {
                        int m4price2 = Convert.ToInt32(m4price);
                        if ((int)Points[Client.XUID] < m4price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_m4_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - m4price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!ak47")
                    {
                        int ak47price2 = Convert.ToInt32(ak47price);
                        if ((int)Points[Client.XUID] < ak47price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_ak47_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - ak47price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!m16")
                    {
                        int m16price2 = Convert.ToInt32(m16price);
                        if ((int)Points[Client.XUID] < m16price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_m16_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - m16price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!fad")
                    {
                        int fadprice2 = Convert.ToInt32(fadprice);
                        if ((int)Points[Client.XUID] < fadprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_fad_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - fadprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!acr")
                    {
                        int acrprice2 = Convert.ToInt32(acrprice);
                        if ((int)Points[Client.XUID] < acrprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_acr_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - acrprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!mk14")
                    {
                        int mk14price2 = Convert.ToInt32(mk14price);
                        if ((int)Points[Client.XUID] < mk14price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_mk14_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - mk14price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!scar")
                    {
                        int scarprice2 = Convert.ToInt32(scarprice);
                        if ((int)Points[Client.XUID] < scarprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_scar_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - scarprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!g36")
                    {
                        int g36price2 = Convert.ToInt32(g36cprice);
                        if ((int)Points[Client.XUID] < g36price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_g36c_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - g36price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!cm901")
                    {
                        int cm901price2 = Convert.ToInt32(cm901price);
                        if ((int)Points[Client.XUID] < cm901price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_cm901_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - cm901price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!claymore")
                    {
                        int cmprice2 = Convert.ToInt32(claymorprice);
                        if ((int)Points[Client.XUID] < cmprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("claymore_mp");
                            Client.Other.Equipment = WepID;
                            Client.Ammo.EquipmentAmmo = 2;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - cmprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    //snipers
                    if (Message == "!barret")
                    {
                        int barrettprice2 = Convert.ToInt32(barretprice);
                        if ((int)Points[Client.XUID] < barrettprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_barrett_mp_barrettscope");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - barrettprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!rsass")
                    {
                        int rsassprice2 = Convert.ToInt32(rsassprice);
                        if ((int)Points[Client.XUID] < rsassprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_rsass_mp_rsassscope");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - rsassprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!msr")
                    {
                        int msrprice2 = Convert.ToInt32(msrprice);
                        if ((int)Points[Client.XUID] < msrprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", 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]) - msrprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!dragunov")
                    {
                        int dragprice2 = Convert.ToInt32(dragunovprice);
                        if ((int)Points[Client.XUID] < dragprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_dragunov_mp_dragunovscope");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - dragprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!l96a1")
                    {
                        int l96a1price2 = Convert.ToInt32(l96a1price);
                        if ((int)Points[Client.XUID] < l96a1price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_l96a1_mp_l96a1scope");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - l96a1price2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!as50")
                    {
                        int as50price2 = Convert.ToInt32(as50price);
                        if ((int)Points[Client.XUID] < as50price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_as50_mp_as50scope");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - as50price2;
                        }

                        return ChatType.ChatNone;
                    }

                    //shotguns
                    if (Message == "!model")
                    {
                        int modelprice2 = Convert.ToInt32(modelprice);
                        if ((int)Points[Client.XUID] < modelprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_1887_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - modelprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!striker")
                    {
                        int strikerprice2 = Convert.ToInt32(strikerprice);
                        if ((int)Points[Client.XUID] < strikerprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_striker_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - strikerprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!aa12")
                    {
                        int aa12price2 = Convert.ToInt32(aa12price);
                        if ((int)Points[Client.XUID] < aa12price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_aa12_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - aa12price2;
                        }

                        return ChatType.ChatNone;
                    }

                    if (Message == "!usas12")
                    {
                        int usasprice2 = Convert.ToInt32(usas12price);
                        if ((int)Points[Client.XUID] < usasprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_usas12_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - usasprice2;
                        }

                        return ChatType.ChatNone;
                    }


                    if (Message == "!spas12")
                    {
                        int spasprice2 = Convert.ToInt32(spas12price);
                        if ((int)Points[Client.XUID] < spasprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("iw5_spas12_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - spasprice2;
                        }

                        return ChatType.ChatNone;
                    }

                    //explosives
                    if (Message == "!rpg")
                    {
                        int rpgprice2 = Convert.ToInt32(rpgprice);
                        if ((int)Points[Client.XUID] < rpgprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("rpg_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - rpgprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!xm25")
                    {
                        int xm25price2 = Convert.ToInt32(xm25price);
                        if ((int)Points[Client.XUID] < xm25price2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("xm25_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - xm25price2;
                        }


                        return ChatType.ChatNone;
                    }

                    if (Message == "!fastermelee")
                    {
                        int FMprice2 = Convert.ToInt32(fm);
                        if ((int)Points[Client.XUID] < FMprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_fastermelee"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - FMprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!fastreload")
                    {

                        int FRprice2 = Convert.ToInt32(fr);
                        if ((int)Points[Client.XUID] < FRprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_fastreload"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - FRprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!scavenger")
                    {

                        int Scavengerprice2 = Convert.ToInt32(sc);
                        if ((int)Points[Client.XUID] < Scavengerprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_scavenger"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - Scavengerprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!blindeye")
                    {

                        int BEprice2 = Convert.ToInt32(be);
                        if ((int)Points[Client.XUID] < BEprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_blindeye"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - BEprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!coldblood")
                    {

                        int CBprice2 = Convert.ToInt32(cb);
                        if ((int)Points[Client.XUID] < CBprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - CBprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!bulletaccuracy")
                    {

                        int BAprice2 = Convert.ToInt32(ba);
                        if ((int)Points[Client.XUID] < BAprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_bulletaccuracy"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - BAprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!stalker")
                    {

                        int Stalkerprice2 = Convert.ToInt32(sk);
                        if ((int)Points[Client.XUID] < Stalkerprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_stalker"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - Stalkerprice2;
                        }

                        return ChatType.ChatNone;
                    }

                }

                if (Client.Team == Teams.Axis)
                {

                    if (Message == "!emp")
                    {
                        int EmpGrenadeprice2 = Convert.ToInt32(empprice);


                        if ((int)Points[Client.XUID] < EmpGrenadeprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            
                            int WepID = GetWeapon("emp_grenade_mp");
                            Client.Other.OffhandWeapon = WepID;
                            Client.Ammo.OffhandAmmo = 2;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - EmpGrenadeprice2;
                        }
                        return ChatType.ChatNone;

                    }

                    if (Message == "!riot")
                    {

                        int shieldprice2 = Convert.ToInt32(shieldprice);
                        if ((int)Points[Client.XUID] < shieldprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            int WepID = GetWeapon("riotshield_mp");
                            Client.Other.PrimaryWeapon = WepID;
                            Client.Other.CurrentWeapon = WepID;
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - shieldprice2;
                        }

                        return ChatType.ChatNone;
                    }

                    if (Message == "!coldblood")
                    {

                        int CB_Zprice2 = Convert.ToInt32(cb);
                        if ((int)Points[Client.XUID] < CB_Zprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_coldblooded"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - CB_Zprice2;
                        }

                        return ChatType.ChatNone;
                    }
                    if (Message == "!stalker")
                    {
                        int Stalker_Zprice2 = Convert.ToInt32(sk);
                        if ((int)Points[Client.XUID] < Stalker_Zprice2)
                        {
                            iPrintLnBold("^1You don't have enough points!", Client);
                        }
                        else
                        {
                            Client.Other.SetPerk(GetPerk("specialty_stalker"));
                            Points[Client.XUID] = ((int)Points[Client.XUID]) - Stalker_Zprice2;
                        }
                        return ChatType.ChatNone;
                    }

                }
            }
            catch { }
            return ChatType.ChatContinue;
        }

        // -----------------------------------------------------------------------------------------
        // End Chat Commands
        // -----------------------------------------------------------------------------------------

        public override string OnCheckBan(string xuid)
        {
            return null;
        }

        public override void OnMapChange()
        {
        }

        public override void OnFastRestart()
        {
        }

        public override void OnPlayerDisconnect(ServerClient Client)
        {
        }

        public override void OnPlayerSpawned(ServerClient Client)
        {
            iPrintLnBold("^2Welcome to CraftBang, use !shop to see the shop", Client);
            if (Points[Client.XUID] == null) { Points.Add(Client.XUID, 0); }
        }



        // <========== SHOP SYSTEMS ==========>
    }
}

Enjoy, you need to know some things are not done like !ksg (shotgun) and more things.
You can modify everything, but I think you also need to credit sailormoon :p
Thanks @sailormoon and @8q4s8
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Code color crosshairs koren30 3 3,989 10-02-2013, 19:26
Last Post: koren30
  Help need help?how to make plugins code hXnarutoXone 12 8,504 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 3,297 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 4,114 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 9,604 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 5,592 07-28-2013, 01:52
Last Post: First_Semyon
  Shop Database Hallla 5 4,761 07-23-2013, 07:33
Last Post: xfxtroll
Wink [Release] Shop system for Infected gametype Nekochan 125 75,675 07-05-2013, 18:09
Last Post: mohammadnanaa
  Code of vector Bloodfocus 1 2,392 06-23-2013, 11:54
Last Post: Yamato
  Help prefix doesnt work with shop koro35 2 2,861 05-18-2013, 10:51
Last Post: koro35

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.