[Mod] Privilege Areas [0.1] [privilegeareas]

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

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

by BirgitLachner » Post

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 » Post

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 » Post

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
Contact:

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

by AntumDeluge » Post

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
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

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

by ManElevation » Post

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/bl ... r/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
Contact:

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

by AntumDeluge » Post

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
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

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

by ManElevation » Post

[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
Contact:

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

by AntumDeluge » Post

The PVP Areas mod seems to work fine for me.

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

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

by taikedz » Post

ManElevation wrote: is this what u are looking? https://github.com/taikedz/pvp_areas/bl ... r/init.lua
The old everamzah links are working again now : https://github.com/everamzah/pvp_areas

AntumDeluge has already PR'd :-p

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

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

by wziard » Post

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: 6281
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

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

by rubenwardy » Post

Merged

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

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

by wziard » Post

rubenwardy wrote:Merged
That was quick :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests