diff options
| -rw-r--r-- | init.lua | 27 | 
1 files changed, 25 insertions, 2 deletions
| @@ -107,7 +107,7 @@ function xban.ban_player(player, source, expires, reason) --> bool, err  	if pl then  		local ip = minetest.get_player_ip(player)  		if ip then -			e.names[ip] = true +			e.names[ip] = os.time()  		end  		e.last_pos = pl:getpos()  	end @@ -229,7 +229,7 @@ minetest.register_on_joinplayer(function(player)  	end  	e.names[name] = true  	if ip then -		e.names[ip] = true +		e.names[ip] = os.time()  	end  	e.last_seen = os.time()  end) @@ -268,6 +268,29 @@ minetest.register_chatcommand("xtempban", {  	end,  }) +minetest.register_chatcommand("xnote", { +	description = "Add a note to a player's criminal record", +	params = "<player> <note>", +	privs = { kick=true }, +	func = function(name, params) +		local plname, note = params:match("(%S+)%s+(.+)") +		if not (plname and note) then +			return false, "Usage: /xnote <player> <note>" +		end +		local record = { +			source = name, +			time = os.time(), +			expires = nil, +			reason = note, +			type = "note", +		} +		xban.add_record(plname, record) +		return true, ("Added note for %s."):format(plname) +	end, +}) + +			       +  minetest.register_chatcommand("xunban", {  	description = "XUnBan a player",  	params = "<player_or_ip> <reason>", | 
