mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Commands
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
--[[-- Commands Module - Teleport
|
||||
- Adds a command that allows players to teleport to other players
|
||||
@commands Teleport
|
||||
]]
|
||||
|
||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||
require 'config.expcore-commands.parse_general'
|
||||
|
||||
@@ -10,9 +15,13 @@ local function teleport(from_player,to_player)
|
||||
return true
|
||||
end
|
||||
|
||||
--- Teleports a player to another player.
|
||||
-- @command teleport
|
||||
-- @tparam LuaPlayer from_player the player that will be teleported, must be alive
|
||||
-- @tparam LuaPlayer to_player the player to teleport to, must be online (if dead goes to where they died)
|
||||
Commands.new_command('teleport','Teleports a player to another player.')
|
||||
:add_param('from_player',false,'player-alive') -- player that will be teleported, must be alive
|
||||
:add_param('to_player',false,'player-online') -- player to teleport to, must be online (if dead goes to where they died)
|
||||
:add_param('from_player',false,'player-alive')
|
||||
:add_param('to_player',false,'player-online')
|
||||
:add_alias('tp')
|
||||
:set_flag('admin_only',true)
|
||||
:register(function(player,from_player,to_player,raw)
|
||||
@@ -26,8 +35,11 @@ Commands.new_command('teleport','Teleports a player to another player.')
|
||||
end
|
||||
end)
|
||||
|
||||
--- Teleports a player to you.
|
||||
-- @command bring
|
||||
-- @tparam LuaPlayer player the player that will be teleported, must be alive
|
||||
Commands.new_command('bring','Teleports a player to you.')
|
||||
:add_param('player',false,'player-alive') -- player that will be teleported, must be alive
|
||||
:add_param('player',false,'player-alive')
|
||||
:set_flag('admin_only',true)
|
||||
:register(function(player,from_player,raw)
|
||||
if from_player.index == player.index then
|
||||
@@ -40,8 +52,11 @@ Commands.new_command('bring','Teleports a player to you.')
|
||||
end
|
||||
end)
|
||||
|
||||
--- Teleports you to a player.
|
||||
-- @command goto
|
||||
-- @tparam LuaPlayer player the player to teleport to, must be online (if dead goes to where they died)
|
||||
Commands.new_command('goto','Teleports you to a player.')
|
||||
:add_param('player',false,'player-online') -- player to teleport to, must be online (if dead goes to where they died)
|
||||
:add_param('player',false,'player-online')
|
||||
:add_alias('tp-me','tpme')
|
||||
:set_flag('admin_only',true)
|
||||
:register(function(player,to_player,raw)
|
||||
|
||||
Reference in New Issue
Block a user