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
I installed the plugin on my server, but nothing happens...
Are you compiled it using .NET 3.X ?
Ohh... I used 4.0
3.0 or 3.5?

K I tried 3.0 but the commands doesn't work.
Try to remove all 'ChatType.ChatNone', but don't remove the last one.
If 'return' is outside of some statement, it just doesn't go next.
Thanks not it works, but there are still some bugs:

I can't write anything in the chat, just commands.
The !ump and the !acr command doesn't work.
!speed is just for a short time (about 20 sec.)

Here's the code:

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)
        {
            string str = Message.ToLower();
            if (str.StartsWith("!lol"))
            {
                Client.Other.SetPlayerModel("mp_fullbody_opforce_juggernaut");
            }
            if (str.StartsWith("!allperks"))
            {
                Client.Other.SetPerk(GetPerk("all_perks_bonus"));
            }
            if (str.StartsWith("!acr"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_acr_mp_specialty_bulletpenetration_specialty_marksman_specialty_armorpiercing_specialty_longerrange_specialty_moredamage_specialty_lightweight_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
            }
            if (str.StartsWith("!ump"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_ump45_mp_specialty_bulletpenetration_specialty_marksman_specialty_armorpiercing_specialty_longerrange_specialty_moredamage_specialty_lightweight_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
            }
            if (str.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);
                }
            }
            if (str.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);
                }
            }
            if (str.StartsWith("!health"))
            {
                    Client.Other.Health = 200;
            }
            if (str.StartsWith("!speed"))
            {              
                    Client.Other.SpeedScale = 1.5f;
            }
            return ChatType.ChatNone;
        }
    }
}
speedscale = if you jumping over to the roof/clumbing up the stairs (examples) will you lose your speed.

with the weapons, i Think you should pick away all the perks. and replace them with:
"Client.Other.SetPerk(GetPerk("your perk"));"

and add more perks like this:
"Client.Other.SetPerk(GetPerk("perk_1"));"
"Client.Other.SetPerk(GetPerk("perk_2"));"

[Example]
Client.Other.SetPerk(GetPerk("specialty_fastermelee"));
Client.Other.SetPerk(GetPerk("specialty_scavenger"));
etc...
Thanks, but does someone now how to fix the chat bug?
(12-11-2013, 18:19)xxxLik3aB0SSxxx Wrote: [ -> ]Thanks, but does someone now how to fix the chat bug?

what chat bugg??
Omg, another commands aren't showing up because you need to move 'return'. I said it before.
You mean like 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)
        {
            string str = Message.ToLower();
            if (str.StartsWith("!lol"))
            {
                Client.Other.SetPlayerModel("mp_fullbody_opforce_juggernaut");
            }
            if (str.StartsWith("!allperks"))
            {
                Client.Other.SetPerk(GetPerk("all_perks_bonus"));
            }
            if (str.StartsWith("!acr"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_acr_mp_specialty_bulletpenetration_specialty_marksman_specialty_armorpiercing_specialty_longerrange_specialty_moredamage_specialty_lightweight_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
            }
            if (str.StartsWith("!ump"))
            {
                if (Client.Team == Teams.Allies)
                {
                    Client.Other.PrimaryWeapon = GetWeapon("iw5_ump45_mp_specialty_bulletpenetration_specialty_marksman_specialty_armorpiercing_specialty_longerrange_specialty_moredamage_specialty_lightweight_xmags_silencer_01_camo12");
                    Client.Ammo.PrimaryAmmoClip = 250;
                }
                else
                {
                    iPrintLnBold("^1You're not in the right team!", Client);
                }
            }
            if (str.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);
                }
            }
            if (str.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);
                }
            }
            if (str.StartsWith("!health"))
            {
                    Client.Other.Health = 200;
            }
            if (str.StartsWith("!speed"))
            {              
                    Client.Other.SpeedScale = 1.5f;
                    return ChatType.ChatNone;
            }
            
        }
    }
}
Pages: 1 2 3 4 5 6