Reign of Kings Provinces / zones

Discussion in 'Plugin Requests' started by [aR]BenjiBlack, May 3, 2015.

  1. We are looking for someone that could make a plugin for out province system! For further information, please send me a message!

    Benji
     
  2. 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
  3. 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?
     
  4. ye! would be cool
     
  5. 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
  6.  
    Last edited by a moderator: May 24, 2015
  7. 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.
     
  8. So I can just create a text document, throw that code in there, and rename it NoAttack.cs?
     
  9. Yessir.
     
  10. 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;
            }
    
     
  11. Is this like Hawthorne's? What's the difference?
     
  12. Mine does not calculate height , there was really no need for this map in my opinion. (2d vs 3d check)

    Regards
     
  13. Does it really need height?

    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".
     
  14. I didn't even see what Hathorne's wrote haha didn't notice unfortunately.

    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 :()
     
  15. I could not get this plugin to function. I tried typing in the exact coordinates for a location and it never put up a zone. I even restarted the server twice.
     
    Last edited by a moderator: May 24, 2015
  16. 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.
     
  17. I did add them in manually. It still didn't populate in the game.
     
  18. 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.
     
  19. 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.
     
  20. I'm currently AFK in your Ventrilo. Please let me know when you're available to discuss the plugin. Thank you.