Skip to content

Instantly share code, notes, and snippets.

@x0rnn
Last active March 1, 2016 17:22
Show Gist options
  • Save x0rnn/fae29961eb78887df131 to your computer and use it in GitHub Desktop.
Save x0rnn/fae29961eb78887df131 to your computer and use it in GitHub Desktop.
#teleport to a player
import minqlx
class goto(minqlx.Plugin):
def __init__(self):
self.add_command("goto", self.cmd_goto, usage="<id>")
haste = ("df_handbreaker4", "handbreaker4_long", "handbreaker", "df_piyofunjumps",
"df_luna", "df_nodown", "df_etleague", "df_extremepkr", "labyrinth", "airmaxjumps",
"sarcasmjump", "criclejump", "cursed_temple", "skacharohuth", "randommap", "just_jump_3",
"criclejump", "eatme")
def cmd_goto(self, player, msg, channel):
if player.team == "spectator":
player.tell("You must join the game first to use this command.") #so you can't /team f;team s;!goto x, plus QL is buggy when you do player_spawn() as spec
return minqlx.RET_STOP_EVENT
if len(msg) == 2:
try:
i = int(msg[1])
target_player = self.player(i)
if not (0 <= i < 64) or not target_player or not self.player(i).is_alive or i == player.id:
raise ValueError
p = target_player
except ValueError:
player.tell("Invalid ID.")
return minqlx.RET_STOP_EVENT
elif len(msg) != 2:
return minqlx.RET_USAGE
minqlx.player_spawn(player.id) #respawn player so he can't cheat by touching the start flag then goto finish
player.position(x=p.state.position.x, y=p.state.position.y, z=p.state.position.z + 26) #+26 needed or else you're stuck in the ground
if self.game.map.lower() in haste:
player.powerups(haste=999)
if self.game.map.lower() == "kraglejump":
player.powerups(haste=60) #some stages need haste and some don't, so 60 is a compromise...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment