Integration (#2)
* set mod name * implement privilege for changing own PvP state * update readmemaster
parent
076d29d030
commit
c876c0123a
|
@ -56,7 +56,6 @@ pvpplus.tournament_hud_update_all() -- Update the list and all player HUDs
|
|||
|
||||
## TODO
|
||||
|
||||
* Add a privilege for changing PvP state
|
||||
* Add a formspec for managing tournaments, accessible from the inventory
|
||||
* Testing
|
||||
|
||||
|
|
18
pvp.lua
18
pvp.lua
|
@ -1,3 +1,5 @@
|
|||
minetest.register_privilege("pvp", "Can configure own PvP setting")
|
||||
|
||||
-- Private table
|
||||
local pvptable = {}
|
||||
|
||||
|
@ -84,6 +86,14 @@ if minetest.get_modpath("unified_inventory") then
|
|||
unified_inventory.register_button("pvp", {
|
||||
type = "image",
|
||||
image = "pvp.png",
|
||||
condition = function(player)
|
||||
return minetest.check_player_privs(
|
||||
player:get_player_name(),
|
||||
{
|
||||
pvp = true
|
||||
}
|
||||
)
|
||||
end,
|
||||
action = function(player)
|
||||
pvpplus.pvp_toggle(player:get_player_name())
|
||||
end
|
||||
|
@ -93,7 +103,9 @@ end
|
|||
minetest.register_chatcommand("pvp_enable", {
|
||||
params = "",
|
||||
description = "Enables PvP",
|
||||
privs = {},
|
||||
privs = {
|
||||
pvp = true
|
||||
},
|
||||
func = function(name, param)
|
||||
if pvpplus.is_pvp(name) then
|
||||
return false, "Your PvP is already enabled."
|
||||
|
@ -104,7 +116,9 @@ minetest.register_chatcommand("pvp_enable", {
|
|||
minetest.register_chatcommand("pvp_disable", {
|
||||
params = "",
|
||||
description = "Disables PvP",
|
||||
privs = {},
|
||||
privs = {
|
||||
pvp = true
|
||||
},
|
||||
func = function(name, param)
|
||||
if not pvpplus.is_pvp(name) then
|
||||
return false, "Your PvP is already disabled."
|
||||
|
|
Loading…
Reference in New Issue