diff options
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r-- | advtrains/init.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua index 33e5b1d..f7d3b13 100644 --- a/advtrains/init.lua +++ b/advtrains/init.lua @@ -738,6 +738,21 @@ minetest.register_chatcommand("at_whereis", end end, }) +minetest.register_chatcommand("at_tp", + { + params = "<train id>", + description = "Teleports you to the position of the train with the given id", + privs = {train_operator = true, teleport = true}, + func = function(name,param) + local train = advtrains.trains[param] + if not train or not train.last_pos then + return false, "Train "..param.." does not exist or is invalid" + else + minetest.get_player_by_name(name):set_pos(train.last_pos) + return true, "Teleporting to train "..param + end + end, +}) minetest.register_chatcommand("at_disable_step", { params = "<yes/no>", |