Compare commits

...

5 Commits

Author SHA1 Message Date
Zemtzov7 24f51d0b95
rebranding to ranks_lite 2022-08-30 14:49:40 +05:00
zmv7 e74749dce6
minor improvement 2022-08-26 03:49:50 +05:00
zmv7 ddba1e1c60
fixed sus typo 2022-08-26 03:41:35 +05:00
zmv7 9a71740c67
minor corrections 2022-08-26 03:40:16 +05:00
zmv7 66cb56bf71
Listed features 2022-08-26 03:31:50 +05:00
2 changed files with 19 additions and 9 deletions

View File

@ -1,6 +1,14 @@
# minetest-mod-ranks
Chat+nametags ranks mod, custom rank text and color
# minetest-mod-ranks_lite
Yet another chat+nametags player-ranks mod
### Features
* No limitations in the rank's text and color, you can use color names(e.g, white,blue,red, etc) and HEX color codes.
* `/getrank` command returning color name/code - remembering color of each rank is not necessary with that ;)
* You can set rank and for online player, and offline, and even not registered yet player as well
* `/players` command that allowing to view a list of online players with their ranks visible
### Usage
* `/getrank [player]` - check your rank or rank of any player
* `/setrank <player> <rank> <color>` - privs: `ranks` - set rank for any player
* `/setrank <player> <rank> <color>` - priv needed: `ranks` - set rank for any player
* `/delrank [player]` - delete your rank or rank of any player
* `/players` - view list of online players with their ranks
* `/players` - view list of online players with their ranks

View File

@ -15,20 +15,22 @@ function ranks.del_rank(name)
rlist:set_string(name,"")
end
core.register_privilege("ranks","Allow manage ranks")
core.register_on_chat_message(function(name,message)
local rank,color = ranks.get_rank(name)
if rank and color and core.check_player_privs(name, {shout = true}) then
--[[if core.get_modpath("irc") then
--[[ Uncomment this section if messages not sending to irc chan
if core.get_modpath("irc") then
irc.say("<"..name.."> "..core.strip_colors(message))
end]]
end
]]
core.log("action","CHAT: "..core.format_chat_message(name,core.strip_colors(message)))
core.chat_send_all(core.format_chat_message(core.colorize(color,rank).." "..name,message))
return true
end
end)
core.register_chatcommand("getrank", {
description="Get rank of player or you",
params="[player]",
@ -43,6 +45,7 @@ core.register_chatcommand("getrank", {
return false, "Specified player doesn't have any rank"
end
end})
core.register_chatcommand("setrank", {
privs={ranks=true},
description="Set rank of player",
@ -83,7 +86,6 @@ core.register_on_joinplayer(function(player)
end
end)
core.register_chatcommand("players", {
description = "List all players currently online with their ranks",
func = function(name, param)