Page 1 of 1

Problem's with player IP's

PostPosted: Wed Aug 07, 2013 06:28
by Cooper97
Hi. I have a big problem: How can I get the IP of a player who is online at the moment. Is there any command like /list-ip or anything like this? If no, is it possible to make a mod who shows an admin the player IP's?

Regards,
Cooper97

PostPosted: Wed Aug 07, 2013 07:15
by sfan5
Put this into a mod:
Code: Select all
minetest.register_chatcommand("getip", {
    params = "<name>",
    description = "Get IP of player",
    privs = {privs = true},
    func = function(name, param)
        if minetest.get_player_by_name(param) == nil then
            minetest.chat_send_player(name, "Player not found")
            return
        end
        minetest.chat_send_player(name, "IP of " .. param .. " is ".. minetest.get_player_ip(param))
    end,
})

Command: /getip <name>
requires privs

PostPosted: Wed Aug 07, 2013 07:23
by Cooper97
Thanks :) I will try it today. Is there any license for your code like CC or WTFPL?

Regards,
Cooper97

PostPosted: Wed Aug 07, 2013 08:15
by sfan5
WTFPL

PostPosted: Wed Aug 07, 2013 08:23
by Cooper97
Thanks. Maybe I make a mod who adds very useful server commands like this :)