version 0.21
This commit is contained in:
parent
bd1233aaf1
commit
c8d70b992c
1717 changed files with 68882 additions and 0 deletions
1
mods/command/depends.txt
Normal file
1
mods/command/depends.txt
Normal file
|
@ -0,0 +1 @@
|
|||
default
|
24
mods/command/info.lua
Normal file
24
mods/command/info.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
INFO_BLANK = "To find out more about certain items type the command '/info' with the params 'update', 'version', 'creative', 'suprise'"
|
||||
INFO_VERSION = "0.1"
|
||||
INFO_UPDATE = "I think nether ... but lot of monster before"
|
||||
INFO_CREATIVE = "Type the command '/gamemode ' and use the params '0' or 's' for survival and '1' or 'c' for creative"
|
||||
|
||||
|
||||
minetest.register_chatcommand("info", {
|
||||
params = "(blank) | update | version | creative",
|
||||
description = "To get info on stuff.",
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name, INFO_BLANK)
|
||||
end
|
||||
if param == "update" then
|
||||
minetest.chat_send_player(name, INFO_UPDATE)
|
||||
end
|
||||
if param == "version" then
|
||||
minetest.chat_send_player(name, INFO_VERSION)
|
||||
end
|
||||
if param == "creative" then
|
||||
minetest.chat_send_player(name, INFO_CREATIVE)
|
||||
end
|
||||
end
|
||||
})
|
42
mods/command/init.lua
Normal file
42
mods/command/init.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
local path = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
-- Load Info command
|
||||
dofile(path.."/info.lua")
|
||||
|
||||
-- Load vanish command
|
||||
dofile(path.."/vanish.lua")
|
||||
|
||||
-- Load time command
|
||||
dofile(path.."/time.lua")
|
||||
|
||||
-- Load kits command
|
||||
dofile(path.."/kits.lua")
|
||||
|
||||
-- By VanessaE, sfan5, and kaeza.
|
||||
local disallowed = {
|
||||
["guest"] = "Guest accounts are disallowed on this server. "..
|
||||
"Please choose a proper username and try again.",
|
||||
["^[0-9]+$"] = "All-numeric usernames are disallowed on this server. "..
|
||||
"Please choose a proper username and try again.",
|
||||
["[0-9].-[0-9].-[0-9].-[0-9].-[0-9]"] = "Too many numbers in your username. "..
|
||||
"Please try again with less than five digits in your username."
|
||||
}
|
||||
minetest.register_on_prejoinplayer(function(name, ip)
|
||||
local lname = name:lower()
|
||||
for re, reason in pairs(disallowed) do
|
||||
if lname:find(re) then
|
||||
return reason
|
||||
end
|
||||
end
|
||||
|
||||
if #name < 2 then
|
||||
return "Too short of a username. "..
|
||||
"Please pick a name with at least two letters and try again."
|
||||
end
|
||||
|
||||
if #name > 30 then
|
||||
return "Too long username. "..
|
||||
"Please pick a name with no more 30 letters and try again."
|
||||
end
|
||||
|
||||
end)
|
26
mods/command/kits.lua
Normal file
26
mods/command/kits.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
minetest.register_chatcommand("kit", {
|
||||
params = "",
|
||||
description = "Add a Kit to player",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name, "No kit selected use ... Aviable : noob , pvp")
|
||||
end
|
||||
local receiverref = core.get_player_by_name(name)
|
||||
if param == "noob" then
|
||||
receiverref:get_inventory():add_item('main', 'default:pick_steel')
|
||||
receiverref:get_inventory():add_item('main', 'default:shovel_steel')
|
||||
receiverref:get_inventory():add_item('main', 'default:torch 16')
|
||||
receiverref:get_inventory():add_item('main', 'default:axe_steel')
|
||||
receiverref:get_inventory():add_item('main', 'default:cobble 64')
|
||||
end
|
||||
if param == "pvp" then
|
||||
receiverref:get_inventory():add_item('main', 'default:sword_diamond')
|
||||
receiverref:get_inventory():add_item('main', 'default:apple_gold 64')
|
||||
receiverref:get_inventory():add_item('main', '3d_armor:helmet_diamond')
|
||||
receiverref:get_inventory():add_item('main', '3d_armor:chestplate_diamond')
|
||||
receiverref:get_inventory():add_item('main', '3d_armor:leggings_diamond')
|
||||
receiverref:get_inventory():add_item('main', '3d_armor:boots_diamond')
|
||||
end
|
||||
end
|
||||
})
|
28
mods/command/time.lua
Normal file
28
mods/command/time.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
minetest.register_chatcommand("night", {
|
||||
params = "",
|
||||
description = "Make the night",
|
||||
privs = {settime = true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
minetest.env:set_timeofday(0.22)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("day", {
|
||||
params = "",
|
||||
description = "Make the day wakeup",
|
||||
privs = {settime = true},
|
||||
func = function(name, param)
|
||||
local player = minetest.env:get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
minetest.env:set_timeofday(0.6)
|
||||
end
|
||||
})
|
||||
|
||||
|
23
mods/command/vanish.lua
Normal file
23
mods/command/vanish.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
vanished_players = {}
|
||||
|
||||
minetest.register_privilege("vanish", "Allow to use /vanish command")
|
||||
|
||||
minetest.register_chatcommand("vanish", {
|
||||
params = "",
|
||||
description = "Make user invisible at eye of all",
|
||||
privs = {vanish = true},
|
||||
func = function(name, param)
|
||||
local prop
|
||||
vanished_players[name] = not vanished_players[name]
|
||||
|
||||
if vanished_players[name] then
|
||||
prop = {visual_size = {x=0, y=0}, collisionbox = {0,0,0,0,0,0}}
|
||||
else
|
||||
-- default player size
|
||||
prop = {visual_size = {x=1, y=1},
|
||||
collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35}}
|
||||
end
|
||||
|
||||
minetest.get_player_by_name(name):set_properties(prop)
|
||||
end
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue