ItsMods

Full Version: Plugin to get weapons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
try this one...
(Not tested!)

Code:
using System;
using System.Collections.Generic;
using Addon;
using System.IO;

namespace NS_Plugin
{
     public class Main : CPlugin
     {

         public override ChatType OnSay(string Message, ServerClient Client)
         {
             if (Message.StartsWith("!lol"))
             {
                 Client.Other.SetPlayerModel("mp_fullbody_opforce_juggernaut");
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!allperks"))
             {
                 Client.Other.SetPerk(GetPerk("all_perks_bonus"));
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!acr"))
             {
                 if (Client.Team == Teams.Allies)
                 {
                     Client.Other.PrimaryWeapon = GetWeapon("iw5_acr_mp_xmags_silencer_01_camo12");
                     Client.Ammo.PrimaryAmmoClip = 250;
                     Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                     Client.Other.SetPerk(GetPerk("specialty_marksman"));
                     Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                     Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                     Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                     Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                 }
                 else
                 {
                     iPrintLnBold("^1You're not in the right team!", Client);
                 }
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!ump"))
             {
                 if (Client.Team == Teams.Allies)
                 {
                     Client.Other.PrimaryWeapon = GetWeapon("iw5_ump45_mp_xmags_silencer_01_camo12");
                     Client.Ammo.PrimaryAmmoClip = 250;
                     Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                     Client.Other.SetPerk(GetPerk("specialty_marksman"));
                     Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                     Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                     Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                     Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                 }
                 else
                 {
                     iPrintLnBold("^1You're not in the right team!", Client);
                 }
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!fmg"))
             {
                 if (Client.Team == Teams.Allies)
                 {
                     Client.Other.SecondaryWeaponAkimbo = true;
                     Client.Other.SecondaryWeapon = GetWeapon("iw5_fmg9_mp");
                     Client.Ammo.SecondaryAkimboAmmo = 300;
                 }
                 else
                 {
                     iPrintLnBold("^1You're not in the right team!", Client);
                 }
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!ammo"))
             {
                 if (Client.Team == Teams.Allies)
                 {
                     Client.Ammo.PrimaryAmmoClip = 250;
                     Client.Ammo.SecondaryAmmoClip = 100;
                 }
                 else
                 {
                     iPrintLnBold("^1You're not in the right team!", Client);
                 }
                 return ChatType.ChatNone;
             }
             if (Message.StartsWith("!health"))
             {
                     Client.Other.Health = 200;
                     return ChatType.ChatNone;
             }
             if (Message.StartsWith("!speed"))
             {              
                     Client.Other.SpeedScale = 1.5f;
                     return ChatType.ChatNone;
             }
            
         }
     }
}

Deleted all the "str" and replaced it with "Message"
It's better to remove 'string str';
I know, btw... That can he edit! Big Grin
Too lazy!
Does somebody know the code of riot shield and rpg?
And how can I make a Primary weapon akimbo?
And last question: how can I make everyone see a message with iPrintLnBold?
i have added shield and a test to see if that message will be shown or other players. (u can't write any messages!!)

i do not recommend to add akimbo on primary weapons, if you change weapon do you cant shoot next time!

Code:
using System;
using System.Collections.Generic;
using Addon;
using System.IO;

namespace NS_Plugin
{
      public class Main : CPlugin
      {

          public override ChatType OnSay(string Message, ServerClient Client)
          {
              if (Message.StartsWith("!lol"))
              {
                  Client.Other.SetPlayerModel("mp_fullbody_opforce_juggernaut");
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!allperks"))
              {
                  Client.Other.SetPerk(GetPerk("all_perks_bonus"));
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!acr"))
              {
                  if (Client.Team == Teams.Allies)
                  {
                      Client.Other.PrimaryWeapon = GetWeapon("iw5_acr_mp_xmags_silencer_01_camo12");
                      Client.Ammo.PrimaryAmmoClip = 250;
                      Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                      Client.Other.SetPerk(GetPerk("specialty_marksman"));
                      Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                      Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                      Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                      Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                  }
                  else
                  {
                      iPrintLnBold("^1You're not in the right team!", Client);
                  }
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!ump"))
              {
                  if (Client.Team == Teams.Allies)
                  {
                      Client.Other.PrimaryWeapon = GetWeapon("iw5_ump45_mp_xmags_silencer_01_camo12");
                      Client.Ammo.PrimaryAmmoClip = 250;
                      Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                      Client.Other.SetPerk(GetPerk("specialty_marksman"));
                      Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                      Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                      Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                      Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                  }
                  else
                  {
                      iPrintLnBold("^1You're not in the right team!", Client);
                  }
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!fmg"))
              {
                  if (Client.Team == Teams.Allies)
                  {
                      Client.Other.SecondaryWeaponAkimbo = true;
                      Client.Other.SecondaryWeapon = GetWeapon("iw5_fmg9_mp");
                      Client.Ammo.SecondaryAkimboAmmo = 300;
                  }
                  else
                  {
                      iPrintLnBold("^1You're not in the right team!", Client);
                  }
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!ammo"))
              {
                  if (Client.Team == Teams.Allies)
                  {
                      Client.Ammo.PrimaryAmmoClip = 250;
                      Client.Ammo.SecondaryAmmoClip = 100;
                  }
                  else
                  {
                      iPrintLnBold("^1You're not in the right team!", Client);
                  }
                  return ChatType.ChatNone;
              }
              if (Message.StartsWith("!health"))
              {
                      Client.Other.Health = 200;
                      return ChatType.ChatNone;
              }
              if (Message.StartsWith("!speed"))
              {              
                      Client.Other.SpeedScale = 1.5f;
                      return ChatType.ChatNone;
              }
              if (Message.StartsWith("!say"))
              {              
                      iPrintLn("Testing if this works.", Client);
                      return ChatType.ChatNone;
              }
              if (Message.Startswith("!shield"))
              {
                      int WepID = GetWeapon("iw5_riotshieldjugg_mp");
                      Client.Other.Equipment = WepID;
                      Client.Ammo.EquipmentAmmo = 0;
                      return ChatType.ChatNone;
              }
              
          }
      }
}
How can I add equipment, e.g. smoke and claymore?
NOT TESTED! Should work!
Primary Akimbos work fine for me and i've tried switching weapons and they still always work!
Try These:
-Akimbo-Fix(New)
-Akimbo-Fix(Old)

Ok This has emp gernades and claymores...

Code:
using System;
using System.Collections.Generic;
using Addon;
using System.IO;

namespace NS_Plugin
{
    public class Main : CPlugin
    {

        public override ChatType OnSay(string Message, ServerClient Client)
        {
            if (Message.StartsWith("!lol"))
            {
                Client.Other.SetPlayerModel("mp_fullbody_opforce_juggernaut");
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!allperks"))
            {
                Client.Other.SetPerk(GetPerk("all_perks_bonus"));
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!acr"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_acr_mp_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                    Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                    Client.Other.SetPerk(GetPerk("specialty_marksman"));
                    Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                    Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                    Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                    Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!ump"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_ump45_mp_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                    Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                    Client.Other.SetPerk(GetPerk("specialty_marksman"));
                    Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                    Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                    Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                    Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!fmg"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.SecondaryWeaponAkimbo = true;
                    Client.Other.SecondaryWeapon = GetWeapon("iw5_fmg9_mp");
                    Client.Ammo.SecondaryAkimboAmmo = 300;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!ammo"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Ammo.PrimaryAmmoClip = 250;
                    Client.Ammo.SecondaryAmmoClip = 100;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!health"))
            {
                Client.Other.Health = 200;
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!speed"))
            {
                Client.Other.SpeedScale = 1.5f;
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!say"))
            {
                iPrintLn("Testing if this works.", Client);
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!shield"))
            {
                int WepID = GetWeapon("iw5_riotshieldjugg_mp");
                Client.Other.Equipment = WepID;
                Client.Ammo.EquipmentAmmo = 0;
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!emp"))
            {
                int WepID = GetWeapon("emp_grenade_mp");
                Client.Other.OffhandWeapon = WepID;
                Client.Ammo.OffhandAmmo = 5;
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!claymore"))
            {
                int WepID = GetWeapon("claymore_mp");
                Client.Other.Equipment = WepID;
                Client.Ammo.EquipmentAmmo = 10;
                return ChatType.ChatNone;
            }

            return ChatType.ChatContinue;
        }
    }
}
Thx now everything works. But there aren't any attachments on my weapons.
I added some new weapons, but they don't work.

Code:
if (str.StartsWith("!msr"))
                {
                    if (Client.Team == Teams.Allies)
                    {
                        Client.Other.PrimaryWeapon = GetWeapon("iw5_msr_mp_xmags_camo12");
                    }
                    return ChatType.ChatNone;
                }
                if (str.StartsWith("!pkp"))
                {
                    if (Client.Team == Teams.Allies)
                    {
                        Client.Other.PrimaryWeapon = GetWeapon("iw5_pecheng_mp_xmags_camo12");
                        Client.Other.SetPerk(GetPerk("specialty_bulletpenetration"));
                        Client.Other.SetPerk(GetPerk("specialty_armorpiercing"));
                        Client.Other.SetPerk(GetPerk("specialty_longerrange"));
                        Client.Other.SetPerk(GetPerk("specialty_fastermelee"));
                        Client.Other.SetPerk(GetPerk("specialty_reducedsway"));
                        Client.Other.SetPerk(GetPerk("specialty_lightweight"));
                        Client.Other.SetPerk(GetPerk("specialty_moredamage"));
                    }
                    return ChatType.ChatNone;
                }
                if (str.StartsWith("!deagle"))
                {
                    if (Client.Team == Teams.Allies)
                    {
                        Client.Other.SecondaryWeapon = GetWeapon("iw5_deserteagle_mp_camo11");
                    }
                    return ChatType.ChatNone;
                }

                if (str.StartsWith("!shield"))
                {
                    int WepID = GetWeapon("iw5_riotshieldjugg_mp");
                    Client.Other.Equipment = WepID;
                    Client.Ammo.EquipmentAmmo = 0;
                    return ChatType.ChatNone;
                }
Do you even have Addon installed? Troll
Pages: 1 2 3 4 5 6