From 717ff750d098076838e2acb6cce7664fd0df7c8c Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Tue, 19 Jan 2016 21:47:42 +0100 Subject: [PATCH] some fixes --- chatcommands.lua | 21 ++++++++------------- factions.conf | 0 init.lua | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 factions.conf diff --git a/chatcommands.lua b/chatcommands.lua index 84c3a3e..1822d6e 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -25,14 +25,14 @@ factions_chat = {} ------------------------------------------------------------------------------- function factions_chat.init() - minetest.register_privilege("factions_user", + minetest.register_privilege("faction_user", { description = "this user is allowed to interact with faction mod", give_to_singleplayer = true, } ) - minetest.register_privilege("factions_admin", + minetest.register_privilege("faction_admin", { description = "this user is allowed to create or delete factions", give_to_singleplayer = true, @@ -43,7 +43,7 @@ function factions_chat.init() { params = " .. ", description = "faction administration functions", - privs = { factions_user=true }, + privs = { faction_user=true }, func = factions_chat.cmdhandler, } ) @@ -52,7 +52,7 @@ function factions_chat.init() { params = "text", description = "send message to all factions", - privs = { factions_user=true }, + privs = { faction_user=true }, func = factions_chat.allfactions_chathandler, } ) @@ -61,7 +61,7 @@ function factions_chat.init() { params = " text", description = "send message to a specific faction", - privs = { factions_user=true }, + privs = { faction_user=true }, func = factions_chat.chathandler, } ) @@ -254,15 +254,9 @@ function factions_chat.cmdhandler(playername,parameter) end if factions.set_free(params[2],value) then - minetest.chat_send_player(playername, - "Factions: free to join for " .. params[2] .. - " has been set to " .. params[3], - false) + minetest.chat_send_player(playername, "Factions: free to join for "..params[2].." has been set to "..params[3], false) else - minetest.chat_send_player(playername, - "Factions: FAILED to set free to join for " .. - params[2], - false) + minetest.chat_send_player(playername, "Factions: FAILED to set free to join for "..params[2], false) end end end @@ -300,6 +294,7 @@ function factions_chat.cmdhandler(playername,parameter) for i=4, #params, 1 do desc = desc .. " " .. params[i] end + if factions.set_description(params[2],desc) then minetest.chat_send_player(playername, "Factions: updated description of faction " .. diff --git a/factions.conf b/factions.conf new file mode 100644 index 0000000..e69de29 diff --git a/init.lua b/init.lua index a5003b4..a8151b1 100644 --- a/init.lua +++ b/init.lua @@ -12,7 +12,7 @@ -- 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 ...")