mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Add /tp Command To Co-Exist With /bring And /go-to (#65)
* Add !evolution to auto-chat.lua * Add !evolution to chat-bot.cfg * Fixed syntax error and converted to two decimal places * Add the /tp command to co-exist with /bring and /go-to * Add /tp command to co-exist with /bring and /go-to into admin.lua * Fix /tp * Fix admin.lua * Fixed Admin.tp call
This commit is contained in:
@@ -214,4 +214,16 @@ function Admin.bring(player,by_player)
|
||||
local _player = Game.get_player(by_player)
|
||||
if not player or not _player then return end
|
||||
player.teleport(_player.surface.find_non_colliding_position('player',_player.position,32,1),_player.surface)
|
||||
end
|
||||
end
|
||||
|
||||
function Admin.tp(from_playaer, to_player)
|
||||
local _from_player = Game.get_player(from_player)
|
||||
local _to_player = Game.get_player(to_player)
|
||||
|
||||
if not _from_player or not _to_player then return end
|
||||
|
||||
if Game.players[_from_player].health >= 0 then return end
|
||||
if Game.players[_to_player].health >= 0 then return end
|
||||
|
||||
_from_player.teleport(_to_player.surface.find_non_colliding_position('player',_to_player.position,32,1),_to_player.surface)
|
||||
end
|
||||
|
||||
@@ -19,3 +19,13 @@ commands.add_command('bring', 'Bring a player to your location', {'player'}, fun
|
||||
if not player then player_return({'commands.invalid-player',args.player}) return commands.error end
|
||||
Admin.bring(player,event)
|
||||
end)
|
||||
|
||||
commands.add_command('tp', 'Teleport a player to another player\'s location', {'from', 'to'}, function(event,args)
|
||||
local from_player = Game.get_player(args.from)
|
||||
if not from_player then player_return({'commands.invalid-player',args.from_player}) return commands.error end
|
||||
|
||||
local to_player = Game.get_player(args.to)
|
||||
if not to_player then player_return({'commands.invalid-player',args.to_player}) return commands.error end
|
||||
|
||||
Admin.tp(from_player, to_player)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user