We are looking for someone that could make a plugin for out province system! For further information, please send me a message!
Benji
Reign of Kings Provinces / zones
Discussion in 'Plugin Requests' started by [aR]BenjiBlack, May 3, 2015.
-
Just the ability to create a safe No PVP/PVE zone for trading and commerce would be amazing. Would greatly benefit an RP server that has a safe RP village designed for that purpose.
This is where I found the idea:
http://oxidemod.org/plugins/zones-manager.739/Last edited by a moderator: May 9, 2015 -
It shouldn't be hard to create a circle zone, aka a point and not allow damage in it's radius if that's what you want?
-
-
This uses 2D vector math in order to calculate a distance from a point, I have included a LOC command to show you xyz, and a list of marks and a global radius. This will achieve what you guys want. Let me know if you need anything else.
Regards
Hawthorne
Moderator edit: Please use the Plugins section for sharing plugins.Last edited by a moderator: May 24, 2015 -
If you need help setting up a script on your server there are several tutorials out there but to make a long story short you should have a folder something like: C:\Program Files (x86)\Steam\steamapps\common\Reign Of Kings\Saves\oxide\plugins
place that script in a file called NoAttack.cs, restart your server.
Go in game and use /loc to get locations you want to mark off and add those marks in void Loaded(). If you still need help feel free message me. -
So I can just create a text document, throw that code in there, and rename it NoAttack.cs?
-
-
Should do for you, x y z are the coodinates of the specific point. You could also change them to a single vector and get the coodinates if you feel like.
Code:bool IsPlayerInRangeOfPoint(Player player1, float x, float y, float z) { float x1 = player.Entity.Position.x, y1 = player.Entity.Position.y, z1 = player.Entity.Position.z; float rangeformula = (float)Math.Sqrt(((x - x1) * (x - x1)) + ((y - y1) * (y - y1)) + ((z - z1) * (z - z1))); if (rangeformula <= range) return true; return false; }
-
-
Mine does not calculate height , there was really no need for this map in my opinion. (2d vs 3d check)
Regards -
Is there a way to add the ability to make a zone "no build"?
And possibly broadcast a message when you walk in the zone?
So one zone could be "Duchy of Blah Blah" and another zone could be "Duchy of Meh Meh". -
Anyway, OnCubePlacement just check whether the player is in the area and cancel the event (either return; or something else. don't have time now ) -
Last edited by a moderator: May 24, 2015
-
You have to add the coordinates to the script. The Loc command does nothing more than show you the location, it does not mark a spot.
Example:
void Loaded()
{
//Add marks
marks.Add(new Vector2(-78.62f,225f));
}
You could expand the script to make placing marks automatic. -
I did add them in manually. It still didn't populate in the game.
-
If you add marks to the list, go to that area and try to attack, someone you will get a message and they will get no damage. It is working and in place on theregulators.org if you want to see it working, it is installed on respawn beaches.
-
I hate to be a downer, but it's still not working. If the /loc command or some other command would automatically populate the points list it would make it a LOT more user friendly.
-
I'm currently AFK in your Ventrilo. Please let me know when you're available to discuss the plugin. Thank you.