This is extremely simple but it's for the people who don't know how to make/add commands.
Step one: Navigate to wServer > Realm > Commands > AdminCommands.cs.
Step two: Copy and paste the following
Code:
internal class ClearInv : Command
{
public ClearInv() :base("ci", 1)
{
}
protected override bool Process(Player player, RealmTime time, string args)
{
for (int i = 0; i < player.Inventory.Length; i++)
{
player.Inventory[i] = null;
player.UpdateCount++;
}
player.SendInfo("Inventory Cleared");
return true;
}
}
Note: No, this isn't completely copied. The method on how it works is different. Much easier to code and probably fast to run?
Code:
string name = string.Join(" ", args.ToArray()).Trim();
name = name.ToLower();
try
{
player.Inventory[4] = null;
player.Inventory[5] = null;
player.Inventory[6] = null;
player.Inventory[7] = null;
player.Inventory[8] = null;
player.Inventory[9] = null;
player.Inventory[10] = null;
player.Inventory[11] = null;
player.UpdateCount++;
return;
}
catch
{
player.SendInfo("Error !");
}
To
Code:
for (int i = 0; i < player.Inventory.Length; i++)
{
player.Inventory[i] = null;
player.UpdateCount++;
}
player.SendInfo("Inventory Cleared");
return true;
Extra
This is for deleting a certain slot
Code:
internal class ClearSlot : Command
{
public ClearSlot() : base("cl", 1)
{
}
protected override bool Process(Player player, RealmTime time, string args)
{
int slot = Convert.ToInt32(args);
if (slot < 11)
{
player.Inventory[slot] = null;
player.UpdateCount++;
player.SendInfo("Slot " + slot + " Cleared!");
return true;
}
else
{
player.SendInfo(slot + " Is not a valid slot. Please choose a slot between [0-11]");
return false;
}
}
}
Note, when you type /cl *number* slots start from "0". So if you type /cl 1 it will remove your spell