I know someone who has a private server, and I am attempting to help. They have an error where ranks 1,2 cannot use any commands, I am apart of one of these groups. If anyone has a solution, please reply to this thread.
Code:
internal class GiveCommand : Command
{
public GiveCommand()
: base("give", 1)
{
}
protected override bool Process(Player player, RealmTime time, string[] args)
{
if (args.Length == 0)
{
player.SendHelp("Usage: /give <Itemname>");
return false;
}
string name = string.Join(" ", args.ToArray()).Trim();
ushort objType;
//creates a new case insensitive dictionary based on the XmlDatas
Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(player.Manager.GameData.IdToObjectType,
StringComparer.OrdinalIgnoreCase);
if (!icdatas.TryGetValue(name, out objType))
{
player.SendError("Unknown type!");
return false;
}
if (!player.Manager.GameData.Items[objType].Secret || player.Client.Account.Rank >= 4)
{
for (int i = 0; i < player.Inventory.Length; i++)
if (player.Inventory[i] == null)
{
player.Inventory[i] = player.Manager.GameData.Items[objType];
player.UpdateCount++;
player.SaveToCharacter();
player.SendInfo("Success!");
break;
}
}
else
{
player.SendError("Item cannot be given!");
return false;
}
return true;
}
}