OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llTeleportAgentGlobalCoords C# (CSharp) Method

llTeleportAgentGlobalCoords() public method

public llTeleportAgentGlobalCoords ( string agent, OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 global_coords, OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 targetPos, OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 targetLookAt ) : void
agent string
global_coords OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
targetPos OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
targetLookAt OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
return void
        public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global_coords, LSL_Vector targetPos, LSL_Vector targetLookAt)
        {
            m_host.AddScriptLPS(1);
            UUID agentId = new UUID();

            ulong regionHandle = Util.RegionWorldLocToHandle((uint)global_coords.x, (uint)global_coords.y);

            if (UUID.TryParse(agent, out agentId))
            {
                // This function is owner only!
                if (m_host.OwnerID != agentId)
                    return;

                ScenePresence presence = World.GetScenePresence(agentId);

                if (presence == null || presence.PresenceType == PresenceType.Npc)
                    return;

                // Can't TP sitting avatars
                if (presence.ParentID != 0) // Sitting
                    return;
                   				
                if (m_item.PermsGranter == agentId)
                {
                    // If attached using llAttachToAvatarTemp, cowardly refuse
                    if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero)
                        return;

                    if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
                    {
                       World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
                    }
                }
            }
        }
LSL_Api