Changed to modpack
parent
e8df9b1bc2
commit
677d6af572
16
guest.lua
16
guest.lua
|
@ -1,16 +0,0 @@
|
||||||
if myadmin.guest == true then
|
|
||||||
minetest.register_on_prejoinplayer(function(name, ip)
|
|
||||||
local n = string.find(string.lower(name),"guest")
|
|
||||||
if n ~= nil then
|
|
||||||
return "\nThe name Guest is not allowed\n\nPlease pick a Name."
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.setting_getbool("disallow_empty_password") == false or nil and
|
|
||||||
myadmin.require_password == true then
|
|
||||||
minetest.setting_setbool("disallow_empty_password", true)
|
|
||||||
elseif minetest.setting_getbool("disallow_empty_password") == true or nil and
|
|
||||||
myadmin.require_password == false then
|
|
||||||
minetest.setting_setbool("disallow_empty_password", false)
|
|
||||||
end
|
|
37
init.lua
37
init.lua
|
@ -1,37 +0,0 @@
|
||||||
local modpath = minetest.get_modpath("myadmin")
|
|
||||||
local input = io.open(modpath.."/settings.txt", "r")
|
|
||||||
|
|
||||||
myadmin = {}
|
|
||||||
|
|
||||||
if input then
|
|
||||||
|
|
||||||
dofile(modpath.."/settings.txt")
|
|
||||||
input:close()
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/tools.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/spawn.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/chat.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/privs.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/curse.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/extras.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/start.lua")
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/underworld.lua")
|
|
||||||
|
|
||||||
if myadmin.guest then
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/guest.lua")
|
|
||||||
end
|
|
||||||
|
|
||||||
if myadmin.names_per_ip then
|
|
||||||
dofile(minetest.get_modpath("myadmin").."/npip.lua")
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
|
||||||
minetest.after(5,function()
|
|
||||||
minetest.chat_send_player(player:get_player_name(), "Welcome "..player:get_player_name().."!")
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
minetest.register_alias("ut", "myadmin:ultimate_tool")
|
minetest.register_alias("ut", "myadmintools:ultimate_tool")
|
||||||
minetest.register_alias("utd", "myadmin:ultimate_tool_drop")
|
minetest.register_alias("utd", "myadmintools:ultimate_tool_drop")
|
||||||
|
|
||||||
minetest.register_tool("myadmin:ultimate_tool", {
|
minetest.register_tool("myadmintools:ultimate_tool", {
|
||||||
description = "Ultimate Tool",
|
description = "Ultimate Tool",
|
||||||
inventory_image = "ultimate_tool.png",
|
inventory_image = "ultimate_tool.png",
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory=1},
|
||||||
|
@ -22,7 +22,7 @@ minetest.register_tool("myadmin:ultimate_tool", {
|
||||||
on_drop = function(itemstack, dropper, pos)
|
on_drop = function(itemstack, dropper, pos)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
minetest.register_tool("myadmin:ultimate_tool_drop", {
|
minetest.register_tool("myadmintools:ultimate_tool_drop", {
|
||||||
description = "Ultimate Tool With Drops",
|
description = "Ultimate Tool With Drops",
|
||||||
inventory_image = "ultimate_tool2.png",
|
inventory_image = "ultimate_tool2.png",
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory=1},
|
||||||
|
@ -45,14 +45,14 @@ minetest.register_tool("myadmin:ultimate_tool_drop", {
|
||||||
|
|
||||||
minetest.register_on_punchnode(function(pos, node, puncher)
|
minetest.register_on_punchnode(function(pos, node, puncher)
|
||||||
local n = node
|
local n = node
|
||||||
if puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool"
|
if puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool"
|
||||||
and minetest.get_node(pos).name ~= "air"
|
and minetest.get_node(pos).name ~= "air"
|
||||||
and minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super == true then
|
and minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super == true then
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
if puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool"
|
if puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool"
|
||||||
or puncher:get_wielded_item():get_name() == "myadmin:ultimate_tool_drop"
|
or puncher:get_wielded_item():get_name() == "myadmintools:ultimate_tool_drop"
|
||||||
and minetest.get_node(pos).name ~= "air" then
|
and minetest.get_node(pos).name ~= "air" then
|
||||||
if minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super ~= true then
|
if minetest.get_player_privs(puncher:get_player_name()).myadmin_levels_super ~= true then
|
||||||
minetest.chat_send_player(puncher:get_player_name(), "You don't have the priv for this tool")
|
minetest.chat_send_player(puncher:get_player_name(), "You don't have the priv for this tool")
|
|
@ -0,0 +1 @@
|
||||||
|
name = myadmintools
|
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
@ -0,0 +1,25 @@
|
||||||
|
local bad_names = {
|
||||||
|
"fuck",
|
||||||
|
"faggot",
|
||||||
|
"asshole",
|
||||||
|
"arsehole",
|
||||||
|
"cunt",
|
||||||
|
"retard",
|
||||||
|
"bitch",
|
||||||
|
"shit",
|
||||||
|
"bastard",
|
||||||
|
"nigger",
|
||||||
|
"nigga",
|
||||||
|
"guest"
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, nm in pairs(bad_names) do
|
||||||
|
|
||||||
|
minetest.register_on_prejoinplayer(function(name, ip)
|
||||||
|
local n = string.find(string.lower(name),nm)
|
||||||
|
if n ~= nil then
|
||||||
|
return "\nThe name .."..name.." is not allowed\n\nPlease pick a different Name."
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
name = mybadnames
|
|
@ -6,6 +6,7 @@ minetest.register_chatcommand("chats", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("afk", {
|
minetest.register_chatcommand("afk", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -13,6 +14,7 @@ minetest.register_chatcommand("afk", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("back", {
|
minetest.register_chatcommand("back", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -20,6 +22,7 @@ minetest.register_chatcommand("back", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("gtg", {
|
minetest.register_chatcommand("gtg", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -27,6 +30,7 @@ minetest.register_chatcommand("gtg", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("bbl", {
|
minetest.register_chatcommand("bbl", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -34,6 +38,7 @@ minetest.register_chatcommand("bbl", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("lol", {
|
minetest.register_chatcommand("lol", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -41,6 +46,7 @@ minetest.register_chatcommand("lol", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("happy", {
|
minetest.register_chatcommand("happy", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -48,6 +54,7 @@ minetest.register_chatcommand("happy", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("sad", {
|
minetest.register_chatcommand("sad", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -55,6 +62,7 @@ minetest.register_chatcommand("sad", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("surprised", {
|
minetest.register_chatcommand("surprised", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -62,6 +70,7 @@ minetest.register_chatcommand("surprised", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("mad", {
|
minetest.register_chatcommand("mad", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -77,6 +86,7 @@ minetest.register_chatcommand("here", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("there", {
|
minetest.register_chatcommand("there", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -84,6 +94,7 @@ minetest.register_chatcommand("there", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("funny", {
|
minetest.register_chatcommand("funny", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -91,6 +102,7 @@ minetest.register_chatcommand("funny", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("crazy", {
|
minetest.register_chatcommand("crazy", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -98,6 +110,7 @@ minetest.register_chatcommand("crazy", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("hurt", {
|
minetest.register_chatcommand("hurt", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -105,6 +118,7 @@ minetest.register_chatcommand("hurt", {
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("mining", {
|
minetest.register_chatcommand("mining", {
|
||||||
privs = {shout = true},
|
privs = {shout = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
|
@ -0,0 +1 @@
|
||||||
|
name = mychats
|
|
@ -1,30 +1,28 @@
|
||||||
local bad_words = myadmin.bad_words
|
local bad_words = {
|
||||||
if bad_words == nil then
|
"fuck",
|
||||||
bad_words = {
|
"faggot",
|
||||||
"fuck",
|
"fag",
|
||||||
"faggot",
|
"gay",
|
||||||
"fag",
|
"asshole",
|
||||||
"gay",
|
"arsehole",
|
||||||
"asshole",
|
"dick",
|
||||||
"arsehole",
|
"cunt",
|
||||||
"dick",
|
"wtf",
|
||||||
"cunt",
|
"retard",
|
||||||
"wtf",
|
"bitch",
|
||||||
"retard",
|
"shit",
|
||||||
"bitch",
|
"bastard",
|
||||||
"shit",
|
"nigger",
|
||||||
"bastard",
|
"nigga"
|
||||||
"nigger",
|
}
|
||||||
"nigga"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
minetest.register_on_chat_message(function(name, message)
|
minetest.register_on_chat_message(function(name, message)
|
||||||
if not message then return end
|
if not message then return end
|
||||||
local msg = message:lower()
|
local msg = message:lower()
|
||||||
for _, word in pairs(bad_words) do
|
for _, word in pairs(bad_words) do
|
||||||
if msg:find(word) then
|
if msg:find(word) then
|
||||||
minetest.kick_player(name, "( ** WATCH YOUR LANGUAGE ** )")
|
minetest.kick_player(name, "( ** WATCH YOUR LANGUAGE ** )")
|
||||||
return
|
return message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
|
@ -0,0 +1 @@
|
||||||
|
name = mycursing
|
|
@ -1,4 +1,4 @@
|
||||||
minetest.register_privilege("myadmin_extras", "Need to use the extras")
|
minetest.register_privilege("myextras", "Need to use the extras")
|
||||||
|
|
||||||
minetest.register_chatcommand("setbar", {
|
minetest.register_chatcommand("setbar", {
|
||||||
params = "",
|
params = "",
|
|
@ -0,0 +1 @@
|
||||||
|
name = myextras
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
minetest.register_privilege("myadmin_levels", "Lets person set level of privlege people have")
|
minetest.register_privilege("myprivs_levels", "Lets person set level of privlege people have")
|
||||||
minetest.register_privilege("myadmin_levels_super", "Lets person set level of privlege people have plus the super level")
|
minetest.register_privilege("myprivs_levels_super", "Lets person set level of privlege people have plus the super level")
|
||||||
|
|
||||||
minetest.register_chatcommand("myadmin_commands", {
|
minetest.register_chatcommand("myprivs_commands", {
|
||||||
privs = {myadmin_levels = true},
|
privs = {myadmin_levels = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
minetest.chat_send_player(name,"Available commands - /admin, /mod, /helper, /norm, /punish, /unpunish, silence, /ghost")
|
minetest.chat_send_player(name,"Available commands - /admin, /mod, /helper, /norm, /punish, /unpunish, silence, /ghost")
|
||||||
|
@ -13,7 +13,7 @@ minetest.register_chatcommand("myadmin_commands", {
|
||||||
minetest.register_chatcommand("super_admin", {
|
minetest.register_chatcommand("super_admin", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Super Administrator",
|
description = "Super Administrator",
|
||||||
privs={myadmin_levels_super=true},
|
privs={myprivs_levels_super=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -43,7 +43,7 @@ end})
|
||||||
minetest.register_chatcommand("admin", {
|
minetest.register_chatcommand("admin", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Administrator",
|
description = "Administrator",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -71,7 +71,7 @@ end})
|
||||||
minetest.register_chatcommand("mod", {
|
minetest.register_chatcommand("mod", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Moderator",
|
description = "Moderator",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -94,7 +94,7 @@ end})
|
||||||
minetest.register_chatcommand("helper", {
|
minetest.register_chatcommand("helper", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Helper",
|
description = "Helper",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -115,7 +115,7 @@ end})
|
||||||
minetest.register_chatcommand("norm", {
|
minetest.register_chatcommand("norm", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Normal Player",
|
description = "Normal Player",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -134,7 +134,7 @@ end})
|
||||||
minetest.register_chatcommand("unpunish", {
|
minetest.register_chatcommand("unpunish", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Unpunish Player",
|
description = "Unpunish Player",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -153,7 +153,7 @@ end})
|
||||||
minetest.register_chatcommand("punish", {
|
minetest.register_chatcommand("punish", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Punish Player",
|
description = "Punish Player",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -169,7 +169,7 @@ end})
|
||||||
minetest.register_chatcommand("silence", {
|
minetest.register_chatcommand("silence", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Silence Player",
|
description = "Silence Player",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
||||||
|
@ -187,7 +187,7 @@ end})
|
||||||
minetest.register_chatcommand("ghost", {
|
minetest.register_chatcommand("ghost", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Remove all privs",
|
description = "Remove all privs",
|
||||||
privs={myadmin_levels=true},
|
privs={myprivs_levels=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if minetest.get_player_by_name(param) then
|
if minetest.get_player_by_name(param) then
|
||||||
minetest.set_player_privs(param, {})
|
minetest.set_player_privs(param, {})
|
|
@ -0,0 +1 @@
|
||||||
|
name = myprivs
|
|
@ -1,35 +1,28 @@
|
||||||
if myadmin.spawn1_name then
|
-- If not using then set the name to nil
|
||||||
if myadmin.spawn1_name ~= false then
|
|
||||||
s1n = myadmin.spawn1_name
|
|
||||||
s1 = myadmin.spawn1
|
|
||||||
end
|
|
||||||
|
|
||||||
if myadmin.spawn2_name ~= false then
|
-- Spawn 1
|
||||||
s2n = myadmin.spawn2_name
|
local s1n = "spawn1"
|
||||||
s2 = myadmin.spawn2
|
local s1 = {x = 0, y = 0, z = 0}
|
||||||
end
|
|
||||||
|
|
||||||
if myadmin.spawn3_name ~= false then
|
-- Spawn 2
|
||||||
s3n = myadmin.spawn3_name
|
local s2n = "spawn2"
|
||||||
s3 = myadmin.spawn3
|
local s2 = {x = 0, y = 0, z = 0}
|
||||||
end
|
|
||||||
|
|
||||||
if myadmin.spawn4_name ~= false then
|
--Spawn 3
|
||||||
s4n = myadmin.spawn4_name
|
local s3n = "spawn3"
|
||||||
s4 = myadmin.spawn4
|
local s3 = {x = 0, y = 0, z = 0}
|
||||||
end
|
|
||||||
|
|
||||||
if myadmin.spawn5_name ~= false then
|
-- Spawn 4
|
||||||
s5n = myadmin.spawn5_name
|
local s4n = nil
|
||||||
s5 = myadmin.spawn5
|
local s4 = {x = 0, y = 0, z = 0}
|
||||||
end
|
|
||||||
else
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
|
-- Spawn 5
|
||||||
|
local s5n = nil
|
||||||
|
local s5 = {x = 0, y = 0, z = 0}
|
||||||
|
|
||||||
|
-- Nothing to change past here
|
||||||
minetest.register_on_chat_message(function(name, message, playername, player)
|
minetest.register_on_chat_message(function(name, message, playername, player)
|
||||||
if s1n ~= false then
|
if s1n ~= nil then
|
||||||
local cmd = "/"..s1n
|
local cmd = "/"..s1n
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/'..s1n then
|
if message == '/'..s1n then
|
||||||
|
@ -41,7 +34,7 @@ minetest.register_on_chat_message(function(name, message, playername, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if s2n ~= false then
|
if s2n ~= nil then
|
||||||
local cmd = "/"..s2n
|
local cmd = "/"..s2n
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/'..s2n then
|
if message == '/'..s2n then
|
||||||
|
@ -53,7 +46,7 @@ minetest.register_on_chat_message(function(name, message, playername, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if s3n ~= false then
|
if s3n ~= nil then
|
||||||
local cmd = "/"..s3n
|
local cmd = "/"..s3n
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/'..s3n then
|
if message == '/'..s3n then
|
||||||
|
@ -65,7 +58,7 @@ minetest.register_on_chat_message(function(name, message, playername, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if s4n ~= false then
|
if s4n ~= nil then
|
||||||
local cmd = "/"..s4n
|
local cmd = "/"..s4n
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/'..s4n then
|
if message == '/'..s4n then
|
||||||
|
@ -77,7 +70,7 @@ minetest.register_on_chat_message(function(name, message, playername, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if s5n ~= false then
|
if s5n ~= nil then
|
||||||
local cmd = "/"..s5n
|
local cmd = "/"..s5n
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/'..s5n then
|
if message == '/'..s5n then
|
|
@ -0,0 +1 @@
|
||||||
|
name = myspawn
|
|
@ -1,11 +1,8 @@
|
||||||
|
|
||||||
local servername = myadmin.server_name
|
local servername = "Our Server"
|
||||||
if servername == nil then
|
|
||||||
local servername = "Our Server"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local f = assert(io.open(minetest.get_modpath("myadmin").."/rules.txt", "r"))
|
local f = assert(io.open(minetest.get_modpath("mystart").."/rules.txt", "r"))
|
||||||
local the_text = f:read("*all")
|
local the_text = f:read("*all")
|
||||||
f:close()
|
f:close()
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
name = mystart
|
116
npip.lua
116
npip.lua
|
@ -1,116 +0,0 @@
|
||||||
-- Created by Krock to stop mass-account-creators
|
|
||||||
-- License: DWYWPL
|
|
||||||
|
|
||||||
ipnames = {}
|
|
||||||
ipnames.data = {}
|
|
||||||
ipnames.tmp_data = {}
|
|
||||||
ipnames.changes = false
|
|
||||||
ipnames.save_interval = 120
|
|
||||||
ipnames.save_time = 0
|
|
||||||
ipnames.file = minetest.get_worldpath().."/ipnames.txt"
|
|
||||||
|
|
||||||
ipnames.name_per_ip_limit = myadmin.names_per_ip
|
|
||||||
|
|
||||||
-- Get accounts self:
|
|
||||||
minetest.register_chatcommand("whois", {
|
|
||||||
description = "Gets all players who have the same IP as the specified player",
|
|
||||||
privs = {kick = true},
|
|
||||||
func = function(name, param)
|
|
||||||
if not ipnames.data[param] then
|
|
||||||
minetest.chat_send_player(name, "The player \"" .. param .. "\" did not join yet.")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local ip = ipnames.data[param]
|
|
||||||
local names = "";
|
|
||||||
for k, v in pairs(ipnames.data) do
|
|
||||||
if v == ip then
|
|
||||||
if names ~= "" then
|
|
||||||
names = names .. ", " .. k
|
|
||||||
else
|
|
||||||
names = names .. " " .. k
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
minetest.chat_send_player(name, "Players for IP address " .. ip .. ": " .. names)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Get IP if player tries to join, ban if there are too much names per IP:
|
|
||||||
minetest.register_on_prejoinplayer(function(name, ip)
|
|
||||||
-- Only stop new accounts:
|
|
||||||
ipnames.tmp_data[name] = ip
|
|
||||||
if not ipnames.data[name] then
|
|
||||||
local count = 1
|
|
||||||
local names = ""
|
|
||||||
for k, v in pairs(ipnames.data) do
|
|
||||||
if v == ip then
|
|
||||||
count = count + 1
|
|
||||||
names = names .. k .. ", "
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if count <= ipnames.name_per_ip_limit and count > 1 then
|
|
||||||
minetest.log("action", name .. " now has " .. count .. " accounts. Other accounts: " .. names)
|
|
||||||
end
|
|
||||||
|
|
||||||
if count > ipnames.name_per_ip_limit then
|
|
||||||
ipnames.tmp_data[name] = nil
|
|
||||||
if tostring(ip) ~= "127.0.0.1" then
|
|
||||||
return ("\nYou exceeded the limit of accounts (" .. ipnames.name_per_ip_limit ..
|
|
||||||
").\nYou already have the following accounts:\n" .. names)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Save IP if player joined:
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
|
||||||
local name = player:get_player_name()
|
|
||||||
ipnames.data[name] = ipnames.tmp_data[name]
|
|
||||||
ipnames.tmp_data[name] = nil
|
|
||||||
ipnames.changes = true
|
|
||||||
end)
|
|
||||||
|
|
||||||
function ipnames.load_data()
|
|
||||||
local file = io.open(ipnames.file, "r")
|
|
||||||
if not file then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for line in file:lines() do
|
|
||||||
if line ~= "" then
|
|
||||||
local data = line:split("|")
|
|
||||||
if #data >= 2 then
|
|
||||||
ipnames.data[data[1]] = data[2]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
io.close(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
function ipnames.save_data()
|
|
||||||
if not ipnames.changes then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
ipnames.changes = false
|
|
||||||
local file = io.open(ipnames.file, "w")
|
|
||||||
for i, v in pairs(ipnames.data) do
|
|
||||||
if v ~= nil then
|
|
||||||
file:write(i .. "|" .. v .. "\n")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
io.close(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_globalstep(function(t)
|
|
||||||
ipnames.save_time = ipnames.save_time + t
|
|
||||||
if ipnames.save_time < ipnames.save_interval then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
ipnames.save_time = 0
|
|
||||||
ipnames.save_data()
|
|
||||||
end)
|
|
||||||
|
|
||||||
minetest.register_on_shutdown(function() ipnames.save_data() end)
|
|
||||||
|
|
||||||
minetest.after(3, function() ipnames.load_data() end)
|
|
|
@ -1,52 +0,0 @@
|
||||||
|
|
||||||
myadmin.server_name = "My Server"
|
|
||||||
|
|
||||||
myadmin.server_message = "Welcome to our server"
|
|
||||||
|
|
||||||
myadmin.guest = true
|
|
||||||
|
|
||||||
myadmin.names_per_ip = 5
|
|
||||||
|
|
||||||
|
|
||||||
-- spawn_name is the name you use in the chat commant
|
|
||||||
-- If you are not using the spawn_name then set it to false
|
|
||||||
|
|
||||||
myadmin.spawn1_name = "spawn"
|
|
||||||
myadmin.spawn1 = {x = 0, y = 0, z = 0}
|
|
||||||
|
|
||||||
myadmin.spawn2_name = "spawn2"
|
|
||||||
myadmin.spawn2 = {x = 0, y = 0, z = 0}
|
|
||||||
|
|
||||||
myadmin.spawn3_name = "spawn3"
|
|
||||||
myadmin.spawn3 = {x = 0, y = 0, z = 0}
|
|
||||||
|
|
||||||
myadmin.spawn4_name = "spawn4"
|
|
||||||
myadmin.spawn4 = {x = 0, y = 0, z = 0}
|
|
||||||
|
|
||||||
myadmin.spawn5_name = "spawn5"
|
|
||||||
myadmin.spawn5 = {x = 0, y = 0, z = 0}
|
|
||||||
|
|
||||||
|
|
||||||
-- If the myadmin_extras priv setting is true then only people with the priv can use the extras
|
|
||||||
|
|
||||||
myadmin.extras_priv = true
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- These are the curse words that are not allowed on the server
|
|
||||||
|
|
||||||
myadmin.bad_words = {
|
|
||||||
"fuck",
|
|
||||||
"faggot",
|
|
||||||
"asshole",
|
|
||||||
"arsehole",
|
|
||||||
"dick",
|
|
||||||
"cunt",
|
|
||||||
"wtf",
|
|
||||||
"retard",
|
|
||||||
"bitch",
|
|
||||||
"shit",
|
|
||||||
"bastard",
|
|
||||||
"nigger",
|
|
||||||
"nigga"
|
|
||||||
}
|
|
196
underworld.lua
196
underworld.lua
|
@ -1,196 +0,0 @@
|
||||||
--[[
|
|
||||||
|
|
||||||
check for stone when placing underworld?
|
|
||||||
|
|
||||||
set underworld teleporter and set meta
|
|
||||||
|
|
||||||
make a schematic for underworld
|
|
||||||
|
|
||||||
make lvm for schematic placement
|
|
||||||
|
|
||||||
decide if this should be a seperate mod
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--]]
|
|
||||||
local tp = {}
|
|
||||||
|
|
||||||
minetest.register_node("myadmin:underworld", {
|
|
||||||
description = "Underworld",
|
|
||||||
tiles = {
|
|
||||||
"default_sand.png^[colorize:#000000:255"
|
|
||||||
},
|
|
||||||
drawtype = "nodebox",
|
|
||||||
paramtype = "light",
|
|
||||||
groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory = 1},
|
|
||||||
node_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.5625, -0.5, 0.4375, -0.4375, 1.5, 0.5625},
|
|
||||||
{0.4375, -0.5, 0.4375, 0.5625, 1.5, 0.5625},
|
|
||||||
{0.4375, -0.5, -0.5625, 0.5625, 1.5, -0.4375},
|
|
||||||
{-0.5625, -0.5, -0.5625, -0.4375, 1.5, -0.4375},
|
|
||||||
{-0.5625, -0.5, -0.5625, 0.5625, -0.4375, 0.5625},
|
|
||||||
{-0.5625, 1.4375, -0.5625, 0.5625, 1.5, 0.5625},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.5625, -0.5, 0.4375, -0.4375, 1.5, 0.5625},
|
|
||||||
{0.4375, -0.5, 0.4375, 0.5625, 1.5, 0.5625},
|
|
||||||
{0.4375, -0.5, -0.5625, 0.5625, 1.5, -0.4375},
|
|
||||||
{-0.5625, -0.5, -0.5625, -0.4375, 1.5, -0.4375},
|
|
||||||
{-0.5625, -0.5, -0.5625, 0.5625, -0.4375, 0.5625},
|
|
||||||
{-0.5625, 1.4375, -0.5625, 0.5625, 1.5, 0.5625},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
|
||||||
|
|
||||||
if minetest.get_player_privs(placer:get_player_name()).myadmin_levels_super == true then
|
|
||||||
|
|
||||||
local pos = pointed_thing.above
|
|
||||||
local top = { x = pos.x, y = pos.y + 1, z = pos.z }
|
|
||||||
|
|
||||||
if top.name ~= air then
|
|
||||||
minetest.chat_send_player(placer, "Not enough room!")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.set_node(pos, {name = "myadmin:underworld"})
|
|
||||||
minetest.set_node(top, {name = "myadmin:underworld_block"})
|
|
||||||
|
|
||||||
minetest.show_formspec(placer:get_player_name(),"fs",
|
|
||||||
"size[6,5;]"..
|
|
||||||
"field[1,1;4.5,1;name;Name;]"..
|
|
||||||
"field[2,2.5;2,1;depth;Depth;]"..
|
|
||||||
"button_exit[2,4;2,1;set;set]")
|
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, fs, fields)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local n = fields["name"]
|
|
||||||
local d = fields["depth"]
|
|
||||||
if tonumber(d) + pos.y > 15000 then
|
|
||||||
d = 15000 + pos.y
|
|
||||||
end
|
|
||||||
if tonumber(d) + pos.y < 3000 then
|
|
||||||
d = 3000 + pos.y
|
|
||||||
end
|
|
||||||
|
|
||||||
if d == "" or
|
|
||||||
d == nil then
|
|
||||||
d = 5000
|
|
||||||
end
|
|
||||||
|
|
||||||
if fields["name"] or
|
|
||||||
fields["depth"] or
|
|
||||||
fields["set"] then
|
|
||||||
|
|
||||||
if fields["name"] ~= "" and
|
|
||||||
fields["depth"] ~= "" then
|
|
||||||
|
|
||||||
meta:set_string("name",n)
|
|
||||||
meta:set_string("infotext",n.." Top at "..d)
|
|
||||||
meta:set_string("depth",d)
|
|
||||||
meta:set_string("torb","top")
|
|
||||||
|
|
||||||
minetest.forceload_block({x = pos.x, y = pos.y - tonumber(d), z = pos.z})
|
|
||||||
|
|
||||||
minetest.set_node({x = pos.x, y = pos.y - tonumber(d), z = pos.z}, {name = "myadmin:underworld"})
|
|
||||||
minetest.set_node({x = pos.x, y = pos.y - tonumber(d) + 1, z = pos.z}, {name = "myadmin:underworld_block"})
|
|
||||||
local dmeta = minetest.get_meta({x = pos.x, y = pos.y - tonumber(d), z = pos.z})
|
|
||||||
dmeta:set_string("name",n.." Underworld")
|
|
||||||
dmeta:set_string("infotext",n.." Underworld at "..d)
|
|
||||||
dmeta:set_string("depth",d)
|
|
||||||
dmeta:set_string("torb","bottom")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
on_dig = function(pos, node, player)
|
|
||||||
|
|
||||||
if minetest.get_player_privs(player:get_player_name()).myadmin_levels_super == true then
|
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local n = meta:get_string("torb")
|
|
||||||
local below = tonumber(meta:get_string("depth"))
|
|
||||||
--if below == nil then below = 1 end
|
|
||||||
local b = { x = pos.x, y = pos.y - below, z = pos.z }
|
|
||||||
local btop = { x = pos.x, y = pos.y - (below - 1), z = pos.z }
|
|
||||||
|
|
||||||
local t = { x = pos.x, y = pos.y + below, z = pos.z }
|
|
||||||
local ttop = { x = pos.x, y = pos.y + (below + 1), z = pos.z }
|
|
||||||
|
|
||||||
local top = { x = pos.x, y = pos.y + 1, z = pos.z }
|
|
||||||
|
|
||||||
if n == "top" then
|
|
||||||
minetest.remove_node(pos)
|
|
||||||
minetest.remove_node(top)
|
|
||||||
minetest.remove_node(b)
|
|
||||||
minetest.remove_node(btop)
|
|
||||||
elseif n == "bottom" then
|
|
||||||
minetest.remove_node(pos)
|
|
||||||
minetest.remove_node(top)
|
|
||||||
minetest.remove_node(t)
|
|
||||||
minetest.remove_node(ttop)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("myadmin:underworld_block", {
|
|
||||||
tiles = {
|
|
||||||
{name="myadmin_underworld_ani_blue.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.5}}
|
|
||||||
},
|
|
||||||
drawtype = "nodebox",
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
pointable = false,
|
|
||||||
light_source = 12,
|
|
||||||
node_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {
|
|
||||||
{-0.4375, -1.4375, -0.4375, 0.4375, 0.4375, 0.4375},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
minetest.register_abm({
|
|
||||||
nodenames = {"myadmin:underworld"},
|
|
||||||
interval = 1,
|
|
||||||
chance = 1,
|
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local t = meta:get_string("name")
|
|
||||||
local depth = tonumber(meta:get_string("depth"))
|
|
||||||
|
|
||||||
if depth == nil then return end
|
|
||||||
|
|
||||||
local up = meta:get_string("torb")
|
|
||||||
|
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
|
||||||
for k, player in pairs(objs) do
|
|
||||||
local p = player:get_player_name()
|
|
||||||
if tp[p] == false then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
tp[p] = true
|
|
||||||
|
|
||||||
if up == "top" and p then
|
|
||||||
tp[p] = false
|
|
||||||
player:setpos({x = pos.x, y = pos.y - depth, z = pos.z})
|
|
||||||
minetest.after(10, function()
|
|
||||||
tp[p] = true
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
tp[p] = false
|
|
||||||
player:setpos({x = pos.x, y = pos.y + depth, z = pos.z})
|
|
||||||
minetest.after(10, function()
|
|
||||||
tp[p] = true
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
Loading…
Reference in New Issue