Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Movement/JumpCommand.cs

35 lines
835 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class JumpCommand: Command
{
public JumpCommand(TestClient testClient)
{
Name = "jump";
Description = "Teleports to the specified height. (e.g. \"jump 10\")";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (args.Length != 1)
return "Usage: jump 10";
float height = 0;
if (!float.TryParse(args[0], out height))
return "Usage: jump 10";
LLVector3 dest = Client.Self.SimPosition;
dest.Z += height;
Client.Self.Teleport(Client.Network.CurrentSim.Name, dest);
return "Attempted to jump " + height + " meters";
}
}
}