mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 16:49:11 +00:00
Default apollo.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<plugin>
|
||||
<id>cmd-teleport</id>
|
||||
<version>1</version>
|
||||
<name>Teleport Commands</name>
|
||||
<description>Adds ::pos and ::tele commands.</description>
|
||||
<authors>
|
||||
<author>Graham</author>
|
||||
</authors>
|
||||
<scripts>
|
||||
<script>teleport.rb</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
</plugin>
|
||||
@@ -0,0 +1,19 @@
|
||||
require 'java'
|
||||
java_import 'org.apollo.game.model.Position'
|
||||
|
||||
on :command, :pos, RIGHTS_ADMIN do |player, command|
|
||||
player.send_message "You are at: " + player.position.to_s
|
||||
end
|
||||
|
||||
on :command, :tele, RIGHTS_ADMIN do |player, command|
|
||||
args = command.arguments
|
||||
if (2..3).include? args.length
|
||||
x = args[0].to_i
|
||||
y = args[1].to_i
|
||||
z = args.length == 3 ? args[2].to_i : 0
|
||||
|
||||
player.teleport Position.new(x, y, z)
|
||||
else
|
||||
player.send_message "Syntax: ::tele [x] [y] [z=0]"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user