Example #1
0
        public string Execute(string[] bits, Blob blob, ClientServerConnection connection, ICommandsApi api, out object[] responseParams)
        {
            Vector3D storeLast;

            responseParams = new object[0];
            string   player             = connection.Credentials.Username;
            EntityId connectionEntityId = api.FindPlayerEntityId(player);
            Entity   entity;

            if (!api.TryGetEntity(connectionEntityId, out entity))
            {
                return("commands.playerEntityNotFound");
            }
            if (StaxelEssentialsHolder.GetBack() == null)
            {
                return("You don't have a place to go back to!");
            }
            storeLast = entity.Physics.Position;
            if (entity.Physics.Teleport(StaxelEssentialsHolder.GetBack()))
            {
                StaxelEssentialsHolder.SetBack(storeLast);
                return("commands.teleport.success");
            }
            return("commands.teleport.distance");
        }