make the message configurable if must be send to all player or not

*  document the configuration settings
main
Герхард PICCORO Lenz McKAY 2022-01-26 09:19:29 -04:00
parent d8d91fd4b2
commit dbf848da08
4 changed files with 28 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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