some fixes

master
Juraj Vajda 2016-01-19 21:47:42 +01:00
parent dc1115cc94
commit 717ff750d0
3 changed files with 9 additions and 14 deletions

View File

@ -25,14 +25,14 @@ factions_chat = {}
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
function factions_chat.init() function factions_chat.init()
minetest.register_privilege("factions_user", minetest.register_privilege("faction_user",
{ {
description = "this user is allowed to interact with faction mod", description = "this user is allowed to interact with faction mod",
give_to_singleplayer = true, give_to_singleplayer = true,
} }
) )
minetest.register_privilege("factions_admin", minetest.register_privilege("faction_admin",
{ {
description = "this user is allowed to create or delete factions", description = "this user is allowed to create or delete factions",
give_to_singleplayer = true, give_to_singleplayer = true,
@ -43,7 +43,7 @@ function factions_chat.init()
{ {
params = "<cmd> <parameter 1> .. <parameter n>", params = "<cmd> <parameter 1> .. <parameter n>",
description = "faction administration functions", description = "faction administration functions",
privs = { factions_user=true }, privs = { faction_user=true },
func = factions_chat.cmdhandler, func = factions_chat.cmdhandler,
} }
) )
@ -52,7 +52,7 @@ function factions_chat.init()
{ {
params = "text", params = "text",
description = "send message to all factions", description = "send message to all factions",
privs = { factions_user=true }, privs = { faction_user=true },
func = factions_chat.allfactions_chathandler, func = factions_chat.allfactions_chathandler,
} }
) )
@ -61,7 +61,7 @@ function factions_chat.init()
{ {
params = "<factionname> text", params = "<factionname> text",
description = "send message to a specific faction", description = "send message to a specific faction",
privs = { factions_user=true }, privs = { faction_user=true },
func = factions_chat.chathandler, func = factions_chat.chathandler,
} }
) )
@ -254,15 +254,9 @@ function factions_chat.cmdhandler(playername,parameter)
end end
if factions.set_free(params[2],value) then if factions.set_free(params[2],value) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername, "Factions: free to join for "..params[2].." has been set to "..params[3], false)
"Factions: free to join for " .. params[2] ..
" has been set to " .. params[3],
false)
else else
minetest.chat_send_player(playername, minetest.chat_send_player(playername, "Factions: FAILED to set free to join for "..params[2], false)
"Factions: FAILED to set free to join for " ..
params[2],
false)
end end
end end
end end
@ -300,6 +294,7 @@ function factions_chat.cmdhandler(playername,parameter)
for i=4, #params, 1 do for i=4, #params, 1 do
desc = desc .. " " .. params[i] desc = desc .. " " .. params[i]
end end
if factions.set_description(params[2],desc) then if factions.set_description(params[2],desc) then
minetest.chat_send_player(playername, minetest.chat_send_player(playername,
"Factions: updated description of faction " .. "Factions: updated description of faction " ..

0
factions.conf Normal file
View File

View File

@ -12,7 +12,7 @@
-- Contact sapier a t gmx net -- Contact sapier a t gmx net
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
local factions_version = "0.1.6" local factions_version = "0.1.5"
core.log("action", "MOD: factions (by sapier) loading ...") core.log("action", "MOD: factions (by sapier) loading ...")