Initial commit.

master
Auke Kok 2019-10-15 16:01:47 -07:00
commit ec27d805b2
3 changed files with 48 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
## YOLO - You Only Live Once
A simple ban-based hardcode mod. Simply install and enable and players
who die will get banned. Other players will see a "RIP" message with a
reason why the player died. The player is instantly kicked and banned
on death.

38
init.lua Normal file
View File

@ -0,0 +1,38 @@
--[[
Copyright (C) 2019 - Auke Kok <sofar@foo-projects.org>
"yolo" is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1
of the license, or (at your option) any later version.
--]]
local reasontbl = {
set_hp = "lost their health",
punch = "got their lights punched out",
fall = "fell to their death",
node_damage = "burnt to a crips",
drown = "swam with the fish",
respawn = "tried to cheat death"
}
minetest.register_on_dieplayer(function(player, reason)
local name = player:get_player_name()
local reasonstr = reasontbl[reason.type] or "expired"
minetest.chat_send_all(
"RIP " .. name .. ", who " .. reasonstr)
local meta = player:get_meta()
meta:set_int("dead", 1)
minetest.kick_player(name, "You died on a hardcore server.")
end)
minetest.register_on_joinplayer(function(player)
local meta = player:get_meta()
if meta:get_int("dead") == 1 then
local name = player:get_player_name()
minetest.kick_player(name, "You died on a hardcore server.")
end
end)

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = yolo
license = LGPL-2.1
description = You Only Live Once - AKA hardcore mode - death is permanent.