make the message configurable if must be send to all player or not
* document the configuration settings
This commit is contained in:
parent
d8d91fd4b2
commit
dbf848da08
11
README.md
11
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
|
||||
|
||||
|
11
README.org
11
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
|
||||
|
||||
|
8
init.lua
8
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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user