Last active
March 9, 2022 00:50
-
-
Save davisonio/686aba40989419dbdff2 to your computer and use it in GitHub Desktop.
Get the IP of a player, Minetest command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minetest.register_chatcommand("ip", { | |
params = "<name>", | |
description = "Show the IP of a player", | |
privs = {server = true}, | |
func = function(name, param) | |
-- If no playername is specified you will get a help message | |
if param == "" then | |
minetest.chat_send_player(name, "Usage: /ip <playername>") | |
return | |
end | |
-- If the player specified does not exist then you will get a message | |
if minetest.get_player_by_name(param) == nil then | |
minetest.chat_send_player(name, "The specified player was not found...") | |
return | |
end | |
-- Gets the IP of the player and sends it to the player who used the command | |
minetest.chat_send_player(name, "IP of ".. param .." is ".. minetest.get_player_ip(param)) | |
end, | |
}) | |
--TO DO | |
--Search auth.txt for players with the same IP. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment