mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 14:16:06 +02:00
initial commit
subgame + mods
This commit is contained in:
34
mods/_misc_kaeza/README.txt
Executable file
34
mods/_misc_kaeza/README.txt
Executable file
@ -0,0 +1,34 @@
|
||||
Well, I've developed a few mods for testing new features in the engine (back
|
||||
when they were new anyway).
|
||||
|
||||
Since these mods have nothing in common, and are rather smallish, I don't
|
||||
want to clutter up the forums with lots of topics. I'll be posting more here
|
||||
as I push them to my repo (and I find where I left them :P).
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
default
|
||||
|
||||
License
|
||||
-------
|
||||
WTFPL for code and media files.
|
||||
|
||||
Download
|
||||
--------
|
||||
ZIP Archive: https://github.com/kaeza/minetest-kaeza_misc/archive/master.zip
|
||||
Browse Code: https://github.com/kaeza/minetest-kaeza_misc
|
||||
|
||||
Mods
|
||||
----
|
||||
|
||||
Currently, these are the things added:
|
||||
|
||||
bookex
|
||||
This overrides the default book. When used, you can write something in it.
|
||||
Useful for taking notes and such.
|
||||
|
||||
testclock
|
||||
This was to test the new Lua HUD system. It adds a clock that shows the
|
||||
time of the day (in-game).
|
||||
|
||||
To uninstall a mod, just remove it from the pack :)
|
0
mods/_misc_kaeza/modpack.txt
Executable file
0
mods/_misc_kaeza/modpack.txt
Executable file
33
mods/_misc_kaeza/notice/init.lua
Executable file
33
mods/_misc_kaeza/notice/init.lua
Executable file
@ -0,0 +1,33 @@
|
||||
|
||||
minetest.register_privilege("notice", "Able to show notices to players.")
|
||||
|
||||
minetest.register_chatcommand("notice", {
|
||||
params = "<player> <text>",
|
||||
privs = { notice=true, },
|
||||
description = "Show a notice to a player.",
|
||||
func = function(name, params)
|
||||
local target, text = params:match("(%S+)%s+(.+)")
|
||||
if not (target and text) then
|
||||
minetest.chat_send_player(name, "Usage: /notice <player> <text>")
|
||||
return
|
||||
end
|
||||
local player = minetest.get_player_by_name(target)
|
||||
if not player then
|
||||
minetest.chat_send_player(name, ("There's no player named '%s'."):format(target))
|
||||
return
|
||||
end
|
||||
local fs = { }
|
||||
local y = 0
|
||||
for _, line in ipairs(text:split("|")) do
|
||||
table.insert(fs, ("label[1,%f;%s]"):format(y+1, minetest.formspec_escape(line)))
|
||||
y = y + 0.5
|
||||
end
|
||||
table.insert(fs, 1, ("size[8,%d]"):format(y+3))
|
||||
table.insert(fs, ("button_exit[3,%f;2,0.5;ok;OK]"):format(y+2))
|
||||
fs = table.concat(fs)
|
||||
minetest.chat_send_player(name, "Notice sent.")
|
||||
minetest.after(0.5, function()
|
||||
minetest.show_formspec(target, "notice:notice", fs)
|
||||
end)
|
||||
end,
|
||||
})
|
Reference in New Issue
Block a user