This commit is contained in:
Cooldude2606
2019-07-22 18:34:42 +01:00
parent 57b1c530bf
commit 604fb66f46
113 changed files with 10840 additions and 88 deletions

View File

@@ -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)