Created
May 31, 2011 22:25
-
-
Save pirogoeth/1001415 to your computer and use it in GitHub Desktop.
Teleport plugin for bravo minecraft server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Teleport(object): | |
implements(IChatCommand) | |
def chat_command(self, username, parameters): | |
p = parse_player(factory, username) | |
if len(parameters) == 0: | |
msg = "not enough parameters..." | |
return (msg,) | |
else: | |
try: to_player = parse_player(factory, parameters[0]) | |
except: return "Player %s is nonexistant!" % (parameters[0]) | |
new_loc = to_player.player.location | |
p.player.location.x = new_loc.x | |
p.player.location.y = new_loc.y | |
p.player.location.z = new_loc.z | |
msg = "Teleported to %s <%s, %s, %s>" % (new_loc.x, new_loc.y, new_loc.z) | |
return msg | |
name = "tp" | |
aliases = tuple("teleport",) | |
usage = "/tp <nickname>" | |
info = "Teleport to another player" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment