minor corrections
parent
66cb56bf71
commit
9a71740c67
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 noy 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