mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-08 22:25:42 +12:00
teleport command
This commit is contained in:
parent
fd64122225
commit
d03fcd1c4c
2 changed files with 28 additions and 1 deletions
|
@ -57,7 +57,9 @@ namespace HISP.Game.Chat
|
||||||
if(message.StartsWith("%STICKBUG"))
|
if(message.StartsWith("%STICKBUG"))
|
||||||
return Command.Stickbug(message, args, user);
|
return Command.Stickbug(message, args, user);
|
||||||
if (message.StartsWith("%GIVE"))
|
if (message.StartsWith("%GIVE"))
|
||||||
return Command.Give(message, args, user); ;
|
return Command.Give(message, args, user);
|
||||||
|
if (message.StartsWith("%GOTO"))
|
||||||
|
return Command.Goto(message, args, user);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (message[0] == '!')
|
if (message[0] == '!')
|
||||||
|
|
|
@ -84,6 +84,31 @@ namespace HISP.Game.Chat
|
||||||
user.LoggedinClient.SendPacket(chatPacket);
|
user.LoggedinClient.SendPacket(chatPacket);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool Goto(string message, string[] args, User user)
|
||||||
|
{
|
||||||
|
if (args.Length <= 0)
|
||||||
|
return false;
|
||||||
|
if (!user.Administrator)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
User teleportTo = GameServer.GetUserByName(args[1]);
|
||||||
|
user.Teleport(teleportTo.X, teleportTo.Y);
|
||||||
|
}
|
||||||
|
catch (KeyNotFoundException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte[] chatPacket = PacketBuilder.CreateChat(Messages.FormatAdminCommandCompleteMessage(message.Substring(1)), PacketBuilder.CHAT_BOTTOM_LEFT);
|
||||||
|
user.LoggedinClient.SendPacket(chatPacket);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public static bool Mute(string message, string[] args, User user)
|
public static bool Mute(string message, string[] args, User user)
|
||||||
|
|
Loading…
Add table
Reference in a new issue