Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugin to get weapons
#31
Sure, some commands work fine, like !acr and !ump, but these don't work
[Image: b_560_95_1.png]
Reply

#32
(12-12-2013, 19:52)xxxLik3aB0SSxxx Wrote: Sure, some commands work fine, like !acr and !ump, but these don't work
Use This...
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("!msr"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_msr_mp_xmags_camo12");
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.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"));
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
                return ChatType.ChatNone;
            }
            if (Message.StartsWith("!deagle"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.SecondaryWeapon = GetWeapon("iw5_deserteagle_mp_camo11");
                }
                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;
        }
    }
}
~FYANB~ Servers Website

Primary Account:
[Image: 76561198070236721.png]
Secondary Account:
[Image: 76561198096107676.png]
Third Account:
[Image: 76561198164751656.png]
Reply

#33
Try to use switch/case statements.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#34
I used your code, but still not works. Is it maybe the .NET Framework? I use 3.0
[Image: b_560_95_1.png]
Reply

#35
i have tested the code now and everything works. are you sure you have installed the addon.dll at right place?
Reply

#36
Now I found the fail: those 3 commands where in the {} of !ump xD
[Image: b_560_95_1.png]
Reply

#37
there's no error in the code!
Reply

#38
Which attachment is reddot?
[Image: b_560_95_1.png]
Reply

#39
reflex = reddot
Reply

#40
(12-12-2013, 19:52)xxxLik3aB0SSxxx Wrote: Sure, some commands work fine, like !acr and !ump, but these don't work

http://www.itsmods.com/forum/Thread-Tuto...ments.html
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] Shop plugin for infected server Petrosyan 0 2,410 01-11-2016, 21:01
Last Post: Petrosyan
  [Request] Full specialist plugin (.dll file prefered) plz check Ph4ntoM 4 3,290 10-24-2015, 20:51
Last Post: Casper
  Help health and ping plugin tamir20121 7 5,632 10-22-2015, 16:09
Last Post: Ph4ntoM
  [Request] Full specialist plugin (.dll file prefered) Ph4ntoM 0 1,863 10-18-2015, 21:18
Last Post: Ph4ntoM
  [Request] Welcome plugin that checks user for VAC bans. graphix2004 0 2,068 07-26-2015, 12:19
Last Post: graphix2004
Brick [Request] Flying plugin 7ru7a21 6 5,284 06-13-2015, 15:27
Last Post: leroi
  Need HUD plugin s.j-rez 7 5,847 11-08-2014, 21:16
Last Post: clacki
  give ammo plugin lander 2 3,199 09-06-2014, 14:10
Last Post: clacki
Heart [Request] Bunker Plugin (Can pay) as4dkhan 2 3,213 08-24-2014, 19:08
Last Post: as4dkhan
Tongue MW3 working jump height, gravity and fall damage plugin request/help Semyel 9 7,940 04-12-2014, 17:36
Last Post: Casper

Forum Jump:


Users browsing this thread:
1 Guest(s)

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