Compare commits
5 Commits
ea071aa346
...
24f51d0b95
Author | SHA1 | Date |
---|---|---|
Zemtzov7 | 24f51d0b95 | |
zmv7 | e74749dce6 | |
zmv7 | ddba1e1c60 | |
zmv7 | 9a71740c67 | |
zmv7 | 66cb56bf71 |
16
README.md
16
README.md
|
@ -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
|
||||
|
|
12
init.lua
12
init.lua
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue