RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

ProTag - PlayerMobile Tag-Based Properties 1.2

No permission to download
To avoid complications when creating scripts based on this, the Get method was set back to return the same as the GetTag RunUO method: The value of the protag or null if the protag doesn't exist.
Two new options were added in the top of the script.

C#:
private static bool GetNeverNull = true; // Setting this to True will make the Get method always return a string (StringForNull) instead of Null when the ProTag is not set.

private static string StringForNull = "Not Set"; // This is the string to be returned if GetNeverNull is set to True.

GetNeverNull is true by default, so you can use this, for example, without worring, as Get will always return a string:

C#:
if (ProTag.Get(target, "PvP") == "ON") { ... }

If GetNeverNull was false, the server would crash if the 'target' had no "PvP" ProTag set.

But if you want to handle yourself the null values, just set GetNeverNull to false.

Also, checks to grant the player account isn't null were added.
Top