Problem's with player IP's

User avatar
Cooper97
Member
 
Posts: 52
Joined: Thu Feb 21, 2013 19:55
Location: Germany

Problem's with player IP's

by Cooper97 » Wed Aug 07, 2013 06:28

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
Sorry for my bad english. (I am from germany.)
 

User avatar
sfan5
Moderator
 
Posts: 3810
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed Aug 07, 2013 07:15

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
Last edited by sfan5 on Wed Aug 07, 2013 07:15, edited 1 time in total.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Cooper97
Member
 
Posts: 52
Joined: Thu Feb 21, 2013 19:55
Location: Germany

by Cooper97 » Wed Aug 07, 2013 07:23

Thanks :) I will try it today. Is there any license for your code like CC or WTFPL?

Regards,
Cooper97
Sorry for my bad english. (I am from germany.)
 

User avatar
sfan5
Moderator
 
Posts: 3810
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed Aug 07, 2013 08:15

WTFPL
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
Cooper97
Member
 
Posts: 52
Joined: Thu Feb 21, 2013 19:55
Location: Germany

by Cooper97 » Wed Aug 07, 2013 08:23

Thanks. Maybe I make a mod who adds very useful server commands like this :)
Sorry for my bad english. (I am from germany.)
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 3 guests