Colorize leave messages (#909)

* add leave message

* Update mods/ctf/ctf_leave_message/init.lua

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update mods/ctf/ctf_leave_message/init.lua

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update mods/ctf/ctf_leave_message/mod.conf

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update mods/ctf/ctf_leave_message/init.lua

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update mods/ctf/ctf_leave_message/init.lua

okay.

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update mods/ctf/ctf_leave_message/init.lua

Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>
This commit is contained in:
ksandr 2021-07-05 23:54:47 +03:00 committed by GitHub
parent 3736223110
commit 24c267c3b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,10 @@
function minetest.send_leave_message(player_name, timed_out)
local player = ctf.player(player_name)
local tcolor = ctf_colors.get_color(player).css
local announcement = "*** " .. minetest.colorize(tcolor, player_name) .. " left the game."
if timed_out then
announcement = announcement .. " (timed out)"
end
minetest.chat_send_all(announcement)
end

View file

@ -0,0 +1,3 @@
name = ctf_leave_message
depends = ctf, ctf_colors
description = Colorizes leaving messages