public void attachplayer(string[] args, Player player)
{
if (args.Length < 2)
{
Logger.Log ("not enough arguments: attachplayer(" + String.Join(" ", args) + ", " + player.Name + ")");
return;
}
string what = args[0];
string where = args[1];
Logger.Log (String.Format("Attaching {0} to {1}'s {2}", what, player.Name, where));
BaseEntity attached = (BaseEntity)GlobalData[string_attachedEntities + player.SteamID];
if (attached != null)
{
player.Message("You already have an object attached to you!");
}
else
{
BaseEntity attach = AttachToPlayer(player, what, where, true);
GlobalData [string_attachedEntities + player.SteamID] = attach;
}
player.Message("Attach to player executed");
}