diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index c6ded79..264a586 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | |||
@@ -32,7 +32,7 @@ using OpenSim.Framework.Console; | |||
32 | using OpenSim.Region.Environment.Interfaces; | 32 | using OpenSim.Region.Environment.Interfaces; |
33 | using OpenSim.Region.Environment.Scenes; | 33 | using OpenSim.Region.Environment.Scenes; |
34 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | 34 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; |
35 | 35 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; | |
36 | //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 36 | //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
37 | 37 | ||
38 | namespace OpenSim.Region.ScriptEngine.Common | 38 | namespace OpenSim.Region.ScriptEngine.Common |
@@ -436,6 +436,34 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | // Teleport functions | ||
440 | public void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
441 | { | ||
442 | m_host.AddScriptLPS(1); | ||
443 | UUID agentId = new UUID(); | ||
444 | if (UUID.TryParse(agent, out agentId)) | ||
445 | { | ||
446 | ScenePresence presence = World.GetScenePresence(agentId); | ||
447 | if (presence != null) | ||
448 | { | ||
449 | // agent must be over owners land to avoid abuse | ||
450 | if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) | ||
451 | { | ||
452 | World.RequestTeleportLocation(presence.ControllingClient, regionName, | ||
453 | new Vector3((float)position.x, (float)position.y, (float)position.z), | ||
454 | new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); | ||
455 | // ScriptSleep(5000); | ||
456 | |||
457 | } | ||
458 | } | ||
459 | } | ||
460 | } | ||
461 | |||
462 | public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) | ||
463 | { | ||
464 | osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); | ||
465 | } | ||
466 | |||
439 | // Adam's super super custom animation functions | 467 | // Adam's super super custom animation functions |
440 | public void osAvatarPlayAnimation(string avatar, string animation) | 468 | public void osAvatarPlayAnimation(string avatar, string animation) |
441 | { | 469 | { |