diff --git a/README.md b/README.md index 9b46648..bb8f218 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,16 @@ Original work can be downloaded from https://notabug.org/gnuhacker/pvpinvul if s ### Configuration -You have the ~pvpinvul_kill_hitter~ option in mod settings, if enable, -players that hit will be killed. +You can set those configurations in the mod tab at the gui, or added those option +to the minetest config file at game directory, to the main global config file. +| config option | type | default | description | +| ------------- | ---- | ------- | ----------- | +| pvpinvul_kill_hitter | bool | false | if enable, players that hit will be killed. | +| pvpinvul_admin_privs | bool | true | if enable, the admin of the server will be automaticaly with pvpinvul privilegies. | +| pvpinvul_send_to_all | bool | true | if enable, when a hitter try to hurt to a invulnerable player, send the message to all players. | + +For more info check https://codeberg.org/venenux/venenux-minetest/src/branch/master/tutorials/manage-minetest-configuration.md ## License diff --git a/README.org b/README.org index 9b46648..bb8f218 100644 --- a/README.org +++ b/README.org @@ -29,9 +29,16 @@ Original work can be downloaded from https://notabug.org/gnuhacker/pvpinvul if s ### Configuration -You have the ~pvpinvul_kill_hitter~ option in mod settings, if enable, -players that hit will be killed. +You can set those configurations in the mod tab at the gui, or added those option +to the minetest config file at game directory, to the main global config file. +| config option | type | default | description | +| ------------- | ---- | ------- | ----------- | +| pvpinvul_kill_hitter | bool | false | if enable, players that hit will be killed. | +| pvpinvul_admin_privs | bool | true | if enable, the admin of the server will be automaticaly with pvpinvul privilegies. | +| pvpinvul_send_to_all | bool | true | if enable, when a hitter try to hurt to a invulnerable player, send the message to all players. | + +For more info check https://codeberg.org/venenux/venenux-minetest/src/branch/master/tutorials/manage-minetest-configuration.md ## License diff --git a/init.lua b/init.lua index 8c235c2..a8a7691 100644 --- a/init.lua +++ b/init.lua @@ -48,6 +48,8 @@ local kill_hitter = core.settings:get_bool("pvpinvul_kill_hitter") or false local admin_privs = core.settings:get_bool("pvpinvul_admin_privs") or true +local send_to_all = core.settings:get_bool("pvpinvul_send_to_all") or true + -- compat with irc mod fork if core.get_modpath("irc") then if irc.saysec == nil then @@ -87,7 +89,11 @@ core.register_on_punchplayer( core.chat_send_player(hitter_name, S("You can not hurt a God") ) core.chat_send_player(player_name, S("@1 try hurt you", hitter_name) ) if core.get_modpath("irc") then - irc.saysec(player_name, hitter_name.." try hurt to "..player_name) + if send_to_all then + irc.saysec(hitter_name.." try hurt to "..player_name) + else + irc.saysec(player_name, hitter_name.." try hurt you") + end end return true end diff --git a/settingtypes.txt b/settingtypes.txt index 2370d16..b5e47c7 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -3,5 +3,7 @@ pvpinvul_kill_hitter (Kill hitter to pvpinvul privilegies) bool false # if enable admin will be pvp invulnerable -pvpinvul_admin_privs (Give automatically to admins pvp ivul privs) bool true +pvpinvul_admin_privs (Give automatically to the admin of server pvp invulnerable privs) bool true +# if enabled send the activity of hurt to invulnerable players to all the chats! +pvpinvul_send_to_all (Send message to all the players and not only those involved) bool true