12-11-2013, 21:20
(This post was last modified: 12-12-2013, 07:21 by EnVi Sweden Rocks.)
try this one...
(Not tested!)
Deleted all the "str" and replaced it with "Message"
(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"