[Mod] Privilege Areas [0.1] [privilegeareas]

User avatar
BirgitLachner
Member
 
Posts: 379
Joined: Thu May 05, 2016 10:18
In-game: Bibs

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

by BirgitLachner » Sun Feb 11, 2018 19:08

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.
 

User avatar
AndroBuilder
Member
 
Posts: 51
Joined: Mon Dec 04, 2017 11:34
In-game: AndroBuilder

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

by AndroBuilder » Mon Feb 12, 2018 22:44

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?
 

User avatar
AndroBuilder
Member
 
Posts: 51
Joined: Mon Dec 04, 2017 11:34
In-game: AndroBuilder

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

by AndroBuilder » Mon Feb 12, 2018 22:45

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
 

User avatar
AntumDeluge
Member
 
Posts: 167
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

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

by AntumDeluge » Tue Jul 24, 2018 19:43

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.
 

User avatar
ManElevation
Member
 
Posts: 896
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation

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

by ManElevation » Tue Jul 24, 2018 20:16

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"}
My Public Mods! Discord: Rottweiler Games#3368
 

User avatar
AntumDeluge
Member
 
Posts: 167
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

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

by AntumDeluge » Tue Jul 24, 2018 21:20

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.
 

User avatar
ManElevation
Member
 
Posts: 896
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation

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

by ManElevation » Tue Jul 24, 2018 21:49

[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
My Public Mods! Discord: Rottweiler Games#3368
 

User avatar
AntumDeluge
Member
 
Posts: 167
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge
 

User avatar
taikedz
Member
 
Posts: 692
Joined: Sun May 15, 2016 11:11
Location: Scotland, UK
GitHub: taikedz
IRC: DuCake
In-game: DuCake
 

wziard
Member
 
Posts: 126
Joined: Mon Oct 29, 2018 19:12

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

by wziard » Fri Nov 16, 2018 20:08

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.
 

User avatar
rubenwardy
Moderator
 
Posts: 5822
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

wziard
Member
 
Posts: 126
Joined: Mon Oct 29, 2018 19:12
 

Previous

Return to Old Mods



Who is online

Users browsing this forum: No registered users and 0 guests