Iomega0318

Member
ServUO Version
Publish 57
Ultima Expansion
Endless Journey
So I know how to add an account tag and how to read it for a script I'm using, I just have no idea where or how to add the tag so it gets added on account creation, could anyone point me in the right direction or possibly show me an example?
 
In literal creation, not the eventsink. There is a moment in the creation process that the player is created. moved into the world, that's a good moment.

Edit: The CreateMobile(Account a) method, that's a nice clean moment to create/read/write an account tag.
 
Last edited:
Hmm I added it here but didn't seem to work, where should I be looking?
C#:
Expand Collapse Copy
        private static Mobile CreateMobile(Account a)
        {
            if (a.Count >= a.Limit)
                return null;

            for (var i = 0; i < a.Length; ++i)
            {
                if (a[i] == null)
                    return (a[i] = new PlayerMobile());
            }

            return null;

            #region Iomega0318 - Charater Stats Display
            if (a.GetTag("displayStats") == null)
            {
                a.SetTag("displayStats", "0");
            }
            #endregion
        }
 
Above any statement that will give the method return. Something like:

C#:
Expand Collapse Copy
private static Mobile CreateMobile(Account a)
        {
             #region Iomega0318 - Charater Stats Display
            if (a.GetTag("displayStats") == null)
            {
                a.SetTag("displayStats", "0");
            }
            #endregion
                
            if (a.Count >= a.Limit)
                return null;

            for (var i = 0; i < a.Length; ++i)
            {
                if (a[i] == null)
                    return (a[i] = new PlayerMobile());
            }

            return null;
        }
 

Donations

Total amount
$10.00
Goal
$500.00

Shards

Back