Check for existing player

master
DonBatman 2016-07-07 07:35:40 -07:00
parent c104366f9d
commit 921d1858af
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,9 @@ for _, nm in pairs(bad_names) do
minetest.register_on_prejoinplayer(function(name, ip)
local n = string.find(string.lower(name),nm)
local wp, err = io.open(minetest.get_worldpath().."/players/"..name, "r")
if wp then return end
wp:close()
if n ~= nil then
return "\nThe name .."..name.." is not allowed\n\nPlease pick a different Name."
end