1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GuardedRegion

Discussion in 'Script Support' started by Zycron, Feb 7, 2014.

  1. Zycron
    Offline

    Zycron New Member

    Joined:
    Feb 2, 2014
    Messages:
    3
    Likes Received:
    0
    Publish Number:
    54
    Trying to make it so reds get insta guard killed unless they are factions i know it has todo with this line

    Code (C#):
    1. public virtual bool AllowReds{ get{ return Core.AOS; } }
    I already added using Server.Factions; to the top just cannot firgure out a way to get the check into that line. any suggestion?

    thanks in advance.
     
  2. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    This is untested code so take it lightly. It's meant to point you in the right direction if it doesn't work but you can try adding something like this to the OnEnter method of GuardedRegion.cs to instant kill Reds that aren't in factions.

    Code (C#):
    1. if (m is PlayerMobile && m.Kills >= 5)
    2. {
    3.     Factions.PlayerState mobileState = Factions.PlayerState.Find(m);
    4.  
    5.     if (mobileState == null)
    6.     {
    7.         this.MakeGuard(m);
    8.     }
    9. }

    Edit: Forgive me if I'm wrong because I haven't done factions since it was first released on OSI many many years ago but aren't some of the faction stones in guarded areas like the the Brit one? How would a red sign up if he was instant killed for not being in a faction?
     
    #2 Kalamus, Feb 8, 2014
    Last edited: Feb 8, 2014
  3. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,425
    Likes Received:
    385
    From what I can remember all but 1 sign up stone are in towns (guarded region) the one which is not I believe was far outside of yew around the crypts.