Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llTeleportAgent C# (CSharp) Method

llTeleportAgent() public method

public llTeleportAgent ( Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString avatar, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString landmark, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 position, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 look_at ) : void
avatar Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString
landmark Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.LSLString
position Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
look_at Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
return void
        public void llTeleportAgent(LSL_Key avatar, LSL_String landmark, LSL_Vector position, LSL_Vector look_at)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;

            UUID invItemID = InventorySelf();

            if (invItemID == UUID.Zero)
                return;

            lock (m_host.TaskInventory)
            {
                if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
                {
                    ShoutError("No permissions to teleport the agent");
                    return;
                }

                if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) == 0)
                {
                    ShoutError("No permissions to teleport the agent");
                    return;
                }
            }

            TaskInventoryItem item = null;
            lock (m_host.TaskInventory)
            {
                foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
                {
                    if (inv.Value.Name == landmark)
                        item = inv.Value;
                }
            }
            if (item == null && landmark != "")
                return;

            IScenePresence presence = World.GetScenePresence(m_host.OwnerID);
            if (presence != null)
            {
                IEntityTransferModule module = World.RequestModuleInterface<IEntityTransferModule>();
                if (module != null)
                {
                    if (landmark == "")
                        module.Teleport(presence, World.RegionInfo.RegionHandle,
                            position.ToVector3(), look_at.ToVector3(), (uint)TeleportFlags.ViaLocation);
                    else
                    {
                        AssetLandmark lm = new AssetLandmark(
                            World.AssetService.Get(item.AssetID.ToString()));
                        module.Teleport(presence, lm.RegionHandle, lm.Position,
                            look_at.ToVector3(), (uint)TeleportFlags.ViaLocation);
                    }
                }
            }
        }
LSL_Api