ServUO Version
Publish 57
Ultima Expansion
Endless Journey
So I have the following which in theory works, however I have the young player status disabled, so it never actually marks the character as young rendering the code useless.

How can I change this to work with new players joining for the first time, or should I just turn young players back on..
C#:
        public static void EventSink_YoungLogin(LoginEventArgs e)
        {
            if (e.Mobile.Player)
            {
                PlayerMobile pm = e.Mobile as PlayerMobile;
                if (pm !=null && pm.Young && (e.Mobile.AccessLevel <= m_AnnounceLevel))
                    CommandHandlers.BroadcastMessage(AccessLevel.Player, m_YoungLoginHue, String.Format(m_YoungLoginMessage, e.Mobile.Name));
                else //broadcast any other level to the staff
                    CommandHandlers.BroadcastMessage(AccessLevel.Counselor, m_YoungLoginHue, String.Format(m_YoungLoginMessage, e.Mobile.Name));
            }
        }
 
You could maybe have it trigger if they are under a given age or total game-time;
C#:
        public static void EventSink_YoungLogin(LoginEventArgs e)
        {
            if (e.Mobile is PlayerMobile pm && pm.GameTime.TotalMinutes < 1.0)
            {
                if (pm.AccessLevel <= m_AnnounceLevel)
                {
                    CommandHandlers.BroadcastMessage(AccessLevel.Player, m_YoungLoginHue, String.Format(m_YoungLoginMessage, pm.Name));
                }
                else //broadcast any other level to the staff
                {
                    CommandHandlers.BroadcastMessage(AccessLevel.Counselor, m_YoungLoginHue, String.Format(m_YoungLoginMessage, pm.Name));
                }
            }
        }
 
I hadn't thought about game time, I'll give that a go.

Seems to be working, as always thank you!
 
Last edited:
Back