Page 2 of 2

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Sun Feb 11, 2018 19:08
by BirgitLachner
The Mod is/might very usefull for educational use. But a more simple usage to define the areas and the given privileges would be good.

The positions could be set by using the wand of WorldEdit and a simple command to define the orivileges would be the best

Set position one and two like in WorldEdit and then one command like ..
Code: Select all
/set_priv_area <name> +fly +creative

... to give fly and creative abilities to the users

Maybe something like ...
Code: Select all
/set_priv_area <name> -interact

... to revoke the interact-prive for an area.

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Mon Feb 12, 2018 22:44
by AndroBuilder
How can i delete or edit a previously set area?
Is it possible to set more than one priv per area and do i need to TAKE this priv or will it automatically turn back?

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Mon Feb 12, 2018 22:45
by AndroBuilder
BirgitLachner wrote:The positions could be set by using the wand of WorldEdit and a simple command to define the orivileges would be the best

Set position one and two like in WorldEdit and then one command like ..
Code: Select all
/set_priv_area <name> +fly +creative

... to give fly and creative abilities to the users

Maybe something like ...
Code: Select all
/set_priv_area <name> -interact

... to revoke the interact-prive for an area.


Very true .... +1

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Tue Jul 24, 2018 19:43
by AntumDeluge
Is it possible to create a PVP area using this mod, leaving the rest of the map non-PVP? I'm sorry, I haven't been able to try it out to see for myself yet. My guess is that it is not possible as PVP seems to be an engine setting for the entire map.

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Tue Jul 24, 2018 20:16
by ManElevation
AntumDeluge wrote:Is it possible to create a PVP area using this mod, leaving the rest of the map non-PVP? I'm sorry, I haven't been able to try it out to see for myself yet. My guess is that it is not possible as PVP seems to be an engine setting for the entire map.

is this what u are looking? https://github.com/taikedz/pvp_areas/blob/master/init.lua
if that dosent work than check out this code
Code: Select all
minetest.register_privilege("pvp", {description = "Enables pvp.", give_to_singleplayer = true})
minetest.register_on_player_receive_fields(function(player, formname, fields)

   localname = player:get_player_name()
   
      if privs.pvp then
      pvptable[localname] = 1
      minetest.chat_send_player(localname,
         "PvP was enabled for "..localname)
            player:hud_remove(pvpdisabled)
            })
      return
      else
      
      pvptable[localname] = 0
      
      minetest.chat_send_player(localname,
         "PvP was disabled for "..localname)
            player:hud_remove(pvpenabled)
      return
      end
   end
end)

if minetest.setting_getbool("enable_pvp") then
   if minetest.register_on_punchplayer then
      minetest.register_on_punchplayer(
         function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage, pvp)
         
         if not hitter:is_player() then
            return false
         end
         
         local localname = player:get_player_name()
         local hittername = hitter:get_player_name()
         
            if pvptable[localname] == 1 and pvptable[hittername] == 1 then
               return false
            else
               minetest.chat_send_player(localname,
               "The player "..hittername.." is trying to attack you.")
               minetest.chat_send_player(hittername,
               "The player "..localname.." does not have PvP activated.")
               return true
            end
      end)
   end
end

i havent tested the code so idk if it works, but you shouldt need to do many fixes to make it work
use this code and the privilege areas.
like ruben said define the area were u want the pvp
Code: Select all
on_enter = {
            grant = {"pvp"}
        },
           
        on_leave = {
            take = {"pvp"}

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Tue Jul 24, 2018 21:20
by AntumDeluge
Oh thank you ManElevation! I will try the pvp_areas mod first.

It appears that everamzah has created a pvp_areas mod as well. Perhaps one is a fork of the other. Doesn't appear to be so at first glance though.

Edit: Actually, sounds like taikedz's mod is a the fork.

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Tue Jul 24, 2018 21:49
by ManElevation
[quote="AntumDeluge"]Oh thank you ManElevation! I will try the pvp_areas mod first./quote]
Sure no problem, if it dosent work let me know

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Wed Jul 25, 2018 17:53
by AntumDeluge
The PVP Areas mod seems to work fine for me.

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Thu Jul 26, 2018 11:07
by taikedz
ManElevation wrote:is this what u are looking? https://github.com/taikedz/pvp_areas/blob/master/init.lua


The old everamzah links are working again now : https://github.com/everamzah/pvp_areas

AntumDeluge has already PR'd :-p

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Fri Nov 16, 2018 20:08
by wziard
I fixed privilege areas to fix with the current 0.5 dev version of minetest (and maybe also 0.4.17? didn't check yet).

I did a pull request on privilege areas github, but no reaction so far.

In case anybody wants the fixed version:
https://github.com/wziard/privilegeareas.git

I'll check the PvP areas mod as well.

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Fri Nov 16, 2018 20:26
by rubenwardy
Merged

Re: [Mod] Privilege Areas [0.1] [privilegeareas]

PostPosted: Sat Nov 17, 2018 18:40
by wziard
rubenwardy wrote:Merged

That was quick :-)