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!

Prevent Impersonation of Staff

Kamron

Knight
Thank you very much Alari.

That is actually HTML code, so it is RRGGBB. the number range from 0 to FF (0 to 255) because its hex.

so white is 255,255,255 which is then FFFFFF. Red is 255,0,0 which is then FF0000
 

Karavoc

Sorceror
love the script, but i was wondering is there any way to make more titles? like having Head gm's and things?
 

Kamron

Knight
Karavoc,
You can add as many as you would like except this is based on accesslevel alone. If you have a custom accesslevel list which you use for more specified staff positions, or based on account tags, then you can alter the script to use that. Although I do not see a pheasible way to determine "Head GM" positions based soley on accesslevels.


Tidous,
Distro is short for Distribution.. it refers to the distribution version of a file, or set of files that comes with RunUO. RC0 is the version (Release Candidate 0). In this case, we are talking about the PlayerMobile.cs. In the Distro version of the file, you can add that code..where as if you had edited the file, you may need to do more to add it.

You can also add this to your CustomMobile, or dovPlayerMobile file instead, either way is fine.
 

nitewender

Wanderer
Well unfortunately GetProperties is used in the new RunUO 1.0.0 and thus breaks the staff impersonation addition :(

Hopefully a way around it will be figured out, it was a great script :)
 

tejster24

Sorceror
Fixed GetProperties() for RunUO 1.0.0
Code:
		public override void GetProperties( ObjectPropertyList list )
  		{
  			base.GetProperties( list );
  
  			if (AccessLevel > AccessLevel.Player)
  			{
  				string color = "";
  				switch ( AccessLevel )
  				{
 		 		case AccessLevel.Counselor: color = "#00BFFF"; break; //Deep Sky Blue
 		 		case AccessLevel.GameMaster: color = "#FF0000"; break; //Red
 		 		case AccessLevel.Seer: color = "#00FF00"; break; //Green
 		 		case AccessLevel.Administrator: color = "#FFD700"; break; //Gold
  				}
 		 	list.Add( 1060658, "{0}\t{1}", "Staff", String.Format("<BASEFONT COLOR={0}>{1}", color, AccessLevelNames[(int)AccessLevel]) );
  			}
  
  			if ( Map == Faction.Facet )
  			{
 				PlayerState pl = PlayerState.Find( this );
  
  				if ( pl != null )
  				{
 					Faction faction = pl.Faction;
  
 					if ( faction.Commander == this )
 		 			list.Add( 1042733, faction.Definition.PropName ); // Commanding Lord of the ~1_FACTION_NAME~
 					else if ( pl.Sheriff != null )
 		 			list.Add( 1042734, "{0}\t{1}", pl.Sheriff.Definition.FriendlyName, faction.Definition.PropName ); // The Sheriff of ~1_CITY~, ~2_FACTION_NAME~
 					else if ( pl.Finance != null )
 		 			list.Add( 1042735, "{0}\t{1}", pl.Finance.Definition.FriendlyName, faction.Definition.PropName ); // The Finance Minister of ~1_CITY~, ~2_FACTION_NAME~
 		 		else if ( pl.MerchantTitle != MerchantTitle.None )
 		 			list.Add( 1060776, "{0}\t{1}", MerchantTitles.GetInfo( pl.MerchantTitle ).Title, faction.Definition.PropName ); // ~1_val~, ~2_val~
  					else
 		 			list.Add( 1060776, "{0}\t{1}", pl.Rank.Title, faction.Definition.PropName ); // ~1_val~, ~2_val~
  				}
  			}
  		}
 

Hands Of God

Sorceror
Sorry to hear u leave spider my shard uses most of ur scripts if not all. Ur one of the best and my shard thanks u. Well miss u From all at Darklords Home.
 

AlienX2

Wanderer
I have problem :( I using RunUO 1.0 RC0... I tried AOS.. but it's not working :( Look this error code: (What do i do?)

Code:
Scripts: Compiling C# scripts...failed (17 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2165, column 18) The ty
pe or namespace name 'Faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2167, column 6) The typ
e or namespace name 'PlayerState' could not be found (are you missing a using di
rective or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0103: (line 2169, column 12) The na
me 'pl' does not exist in the class or namespace 'Server.Mobiles.PlayerMobile'
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2171, column 7) The typ
e or namespace name 'Faction' could not be found (are you missing a using direct
ive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2173, column 12) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2174, column 27) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2175, column 17) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2176, column 39) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2176, column 75) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2177, column 17) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2178, column 39) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2178, column 75) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2179, column 17) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2180, column 63) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2180, column 89) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2182, column 39) The ty
pe or namespace name 'pl' could not be found (are you missing a using directive
or an assembly reference?)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0246: (line 2182, column 54) The ty
pe or namespace name 'faction' could not be found (are you missing a using direc
tive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Kamron

Knight
I am sorry, I am no longer supporting RC0. You are encouraged and required to update to RunUO 1.0.0. If you are unable to update, then you will not receive support. And I say this because that error was caused by the additions to 1.0.0, which you do not have.
 

Joeblow

Wanderer
FYI, I got errors with the 1.0.0 version of this code...will post them later...
If I remember right it said that "AccessLevelNames property could not be found.

I assume ( I know I am an a$$) this is the line it refers to...will look at it more later and give you more info...

list.Add( 1060658, "{0}\t{1}", "Staff", String.Format("<BASEFONT COLOR={0}>{1}", color, AccessLevelNames[(int)AccessLevel]) );
 

Kamron

Knight
Did you take a look at the blue code above the GetProperties additions? You need to add that as well or else you will get that error.
 

Joeblow

Wanderer
XxSP1DERxX said:
Did you take a look at the blue code above the GetProperties additions? You need to add that as well or else you will get that error.

duh I feel like a retard now. Thx Spider. I knew I was missing something simple. Just had to find it. I was trying to add that during lunch and didn't have much time to play around. LOL Thx again.
 

Nine_Coronas

Wanderer
heres my error:
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 41706
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS1513: (line 2393, column 2) } expec
ted
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

heres my addon...i think i screwed up somewhere:
Code:
public static string[] AccessLevelNames = new string[]
			{
				{
				"Player",
				"Counselor",
				"HeadCounselor",
				"Game Master",
				"HeadGameMaster",
				"Seer",
				"HeadSeer",
				"Scripter",
				"HeadScripter",
				"Administrator",
				"HeadAdministrator",
				"CoOwner",
				"Owner"
};

		public override void GetProperties( ObjectPropertyList list )
  		{
  			base.GetProperties( list );
  
  			if (AccessLevel > AccessLevel.Player)
  			{
  				string color = "";
  				switch ( AccessLevel )
  				{
				case AccessLevel.Owner: return 0x481;
				case AccessLevel.CoOwner: return 0x485;
				case AccessLevel.HeadAdministrator: return 0x484;
 		 		case AccessLevel.Administrator: color = "#FFD700"; break; //Gold
				case AccessLevel.HeadScripter: return 0x483;
				case AccessLevel.Scripter: return 0x497;
				case AccessLevel.HeadSeer: return 0x486;
 		 		case AccessLevel.Seer: color = "#00FF00"; break; //Green
				case AccessLevel.HeadGameMaster: return 0x489;
 		 		case AccessLevel.GameMaster: color = "#FF0000"; break; //Red
				case AccessLevel.HeadCounselor: return 0x48E;
 		 		case AccessLevel.Counselor: color = "#00BFFF"; break; //Deep Sky Blue
  				}
 		 	list.Add( 1060658, "{0}\t{1}", "Staff", String.Format("<BASEFONT COLOR={0}>{1}", color, AccessLevelNames[(int)AccessLevel]) );
  			}
 

Victor

Wanderer
Nine_Coronas said:
heres my error:
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 41706
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS1513: (line 2393, column 2) } expec
ted
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

The error is clear, you did not close a code block with "}".

Edit: I think this is your problem see that extra "{" I highlighted in red, get rid of it
Code:
public static string[] AccessLevelNames = new string[]
			{
				[COLOR="Red"]{[/COLOR]
				"Player",
				"Counselor",
				"HeadCounselor",
				"Game Master",
				"HeadGameMaster",
				"Seer",
				"HeadSeer",
				"Scripter",
				"HeadScripter",
				"Administrator",
				"HeadAdministrator",
				"CoOwner",
				"Owner"
};
 

Nine_Coronas

Wanderer
ok i removed that "}" and heres what i got

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 41706
Scripts: Compiling C# scripts...failed (16 errors, 16 warnings)
 - Warning: Scripts\customs\A_Li_N's Paintball 1.1.0\PBGameItem.cs: CS0183: (lin
e 196, column 13) The given expression is always of the provided ('Server.Mobile
') type
 - Warning: Scripts\customs\ExplodeCommand\Explode.cs: CS0183: (line 38, column
28) The given expression is always of the provided ('Server.Mobile') type
 - Warning: Scripts\customs\ExplodeCommand\Explode.cs: CS0183: (line 44, column
28) The given expression is always of the provided ('Server.Mobile') type
 - Warning: Scripts\customs\HarvestSystem\Garden\GardenDeed.cs: CS0162: (line 16
6, column 4) Unreachable code detected
 - Warning: Scripts\customs\HarvestSystem\Garden\SecureGarden.cs: CS0162: (line
123, column 10) Unreachable code detected
 - Warning: Scripts\customs\KillarQuest\SwordOfKillar.cs: CS0162: (line 63, colu
mn 30) Unreachable code detected
 - Warning: Scripts\customs\MLAddons\AquariumEastAddon.cs: CS0219: (line 22, col
umn 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\AquariumSouthAddon.cs: CS0219: (line 22, co
lumn 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\ElvenBedEastAddon.cs: CS0219: (line 22, col
umn 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\ElvenBedSouthAddon.cs: CS0219: (line 22, co
lumn 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\ParrotPerchEastAddon.cs: CS0219: (line 21,
column 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\ParrotPerchSouthAddon.cs: CS0219: (line 21,
 column 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\StoneCoffinEastAddon.cs: CS0219: (line 22,
column 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\MLAddons\StoneCoffinSouthAddon.cs: CS0219: (line 22,
 column 19) The variable 'ac' is assigned but its value is never used
 - Warning: Scripts\customs\RaceGump.cs: CS0162: (line 377, column 6) Unreachabl
e code detected
 - Warning: Scripts\Engines\watchuo_10\Core.cs: CS0168: (line 56, column 7) The
variable 'ode' is declared but never used
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2222, column 29) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 12:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2223, column 31) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 11:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2224, column 41) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 10:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2226, column 36) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 8:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2227, column 32) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 7:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2228, column 32) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 6:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2230, column 38) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 4:') to another
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2232, column 37) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0163: (line 2220, column 7) Control
 cannot fall through from one case label ('case 2:') to another
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

here is that area

Code:
public static string[] AccessLevelNames = new string[]
			{
				"Player",
				"Counselor",
				"HeadCounselor",
				"Game Master",
				"HeadGameMaster",
				"Seer",
				"HeadSeer",
				"Scripter",
				"HeadScripter",
				"Administrator",
				"HeadAdministrator",
				"CoOwner",
				"Owner"
			};

		public override void GetProperties( ObjectPropertyList list )
  		{
  			base.GetProperties( list );
  
  			if (AccessLevel > AccessLevel.Player)
  			{
  				string color = "";
  				switch ( AccessLevel )
  				{
				case AccessLevel.Owner: return 0x481;
				case AccessLevel.CoOwner: return 0x485;
				case AccessLevel.HeadAdministrator: return 0x484;
 		 		case AccessLevel.Administrator: color = "#FFD700"; break; //Gold
				case AccessLevel.HeadScripter: return 0x483;
				case AccessLevel.Scripter: return 0x497;
				case AccessLevel.HeadSeer: return 0x486;
 		 		case AccessLevel.Seer: color = "#00FF00"; break; //Green
				case AccessLevel.HeadGameMaster: return 0x489;
 		 		case AccessLevel.GameMaster: color = "#FF0000"; break; //Red
				case AccessLevel.HeadCounselor: return 0x48E;
 		 		case AccessLevel.Counselor: color = "#00BFFF"; break; //Deep Sky Blue
  				}
 		 	list.Add( 1060658, "{0}\t{1}", "Staff", String.Format("<BASEFONT COLOR={0}>{1}", color, AccessLevelNames[(int)AccessLevel]) );
  			}
 

Victor

Wanderer
This time your errors are in other scripts. Look at the error messages, this time there is errors in gardendeed.cs, explode.cs, securegarden.cs, etc.
 

Victor

Wanderer
Nine_Coronas said:
those are warnings if you looked, the errors are at the bottem if u use the scroll
Oh yes, I see.
Code:
Error: Scripts\Mobiles\PlayerMobile.cs: CS0127: (line 2222, column 29) Since
'Server.Mobiles.PlayerMobile.GetProperties(Server.ObjectPropertyList)' returns v
oid, a return keyword must not be followed by an object expression
This error is of the most importance because the method is declared with void return type you can not use those returns you have in your switch case.
 
Top