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!

[Stable command

Emillio

Sorceror
[Stable command

hi,

on my shard i don't want to do the pet shrink thing, but i had the idea of having people be able to stable their pet anywhere. I'm new to scripting. I took the best looking parts out of several scripts already there, (like a [hue command i have and the animal trainer) and tried to put this together. I was expecting 300 errors, but only got a few. can someone help me?

here is the error
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (6 errors, 0 warnings)
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 13, column 15) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 19, column 15) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 23, column 17) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 27, column 21) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 32, column 10) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1022: (line 37, column 3) Type or
namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

and here's my first script (of sorts since its taken from already existing ones)
Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;

using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
public static void Initialize() 
	}
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
} 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;

		public static void Initialize() 
  { 
      			Server.Commands.Register( "Stable", AccessLevel.Player, new CommandEventHandler( Hue_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
     { 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
        {
			m_stable = stable;
		}	
		}	



public static int GetMaxStabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class StableTarget : Target
{
				

			protected override void OnTarget( Mobile from, object targeted )
	{
				if ( targeted is BaseCreature )
					m_Trainer.EndStable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void BeginStable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.Stabled.Count >= GetMaxStabled( from ) )
    {
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
	 {
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new StableTarget( this );
			}
		}

thank you for any help you all can give.
 

Emillio

Sorceror
I'm sorry that doesn't help me. It took all i currently know just to get this far. Most other scripts just look like japanese to me. Could you give me a little guidance on how i could fix my script? thank you. I'm trying to learn scripting. If i can figure out where my scripting went wrong, i can get better at it. It's not so much about the end product.
 

Malaperth

Wanderer
Well said. Ok, if that is the entire script, you need to identify the class and the namespace of the class. Take a look at another script to see what is at the top (using statements), and then a namespace statement, then a class definition so the compiler knows what it's looking at.
 

Emillio

Sorceror
thanks so much. And um, i just realized a big chunk of my copy and paste didn't actually GO into my script shown above! lol. I've edited that post to avoid refilling the screen. Could you look at it and see if i did it right? Ty :)
 

Malaperth

Wanderer
Code:
namespace Server.Factions.Scripts.Commands 
{ 
    [COLOR="Red"] public class StableCommand
     {[/COLOR]
public static void Initialize() 
	}

You'll need something like that in there and another closing brace at the end ( } ).

And that brace you have at Initialize needs to be turned around. A code block opens with { and closes with }
 

Emillio

Sorceror
k thanks! here is new errors

Code:
 - Error: Scripts\Customs\montoyastable.cs: CS1513: (line 22, column 16) } expec
ted
 - Error: Scripts\Customs\montoyastable.cs: CS1520: (line 33, column 10) Class,
struct, or interface method must have a return type
 - Error: Scripts\Customs\montoyastable.cs: CS1002: (line 33, column 37) ; expec
ted
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 33, column 73) Invalid
 token ')' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 35, column 13) Invalid
 token '=' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 35, column 21) Invalid
 token ';' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 41, column 15) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 43, column 55) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 44, column 53) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 45, column 53) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1022: (line 69, column 3) Type or
namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


and new script :

Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;

using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
 public class StableCommand
{
public static void Initialize() 
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
{ 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;

		public static void Initialize() 
{ 
      			Server.Commands.Register( "Stable", AccessLevel.Player, new CommandEventHandler( Hue_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
{ 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}	
		}	



public static int GetMaxStabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class StableTarget : Target
{
				

			protected override void OnTarget( Mobile from, object targeted )
{
				if ( targeted is BaseCreature )
					m_Trainer.EndStable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void BeginStable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
{
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new StableTarget( this );
			}
		}

}
}
}
}

only thing i can think of is the little { but i have 14 going one way and 14 going another.
 

Malaperth

Wanderer
Remember when I said that a code block opens with { and closes with } ?

take a look at the end of your Initialize method.

Also, download Visual C# Express from the thread in Announcements. It will help you with all sorts of errors like this one.
 

Emillio

Sorceror
you meant that it said hue on command instead of stable. if its that, i saw it.

As far as the code block, i think i don't exactly understand what constitutes a code block. When is it time to put the closing } before opening a new one. So i'm not sure what you mean. thanks again, i'm learning a lot from this!

as far as visual express - ill dl it. hope it works on dreaded millenium. hehe
 

Malaperth

Wanderer
Code:
public static void Initialize() 
[COLOR="Red"]{ <-- open[/COLOR]
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
[COLOR="Red"]{ <-- open, should be close[/COLOR]
 

Emillio

Sorceror
k i did that. now its saying:

Code:
ted
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 33, column 73) Invalid
 token ')' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 35, column 13) Invalid
 token '=' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 35, column 21) Invalid
 token ';' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 41, column 15) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 43, column 55) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 44, column 53) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 45, column 53) Expecte
d class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1527: (line 70, column 1) Namespac
e elements cannot be explicitly declared as private, protected, or protected int
ernal
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 86, column 8) Expected
 class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1022: (line 106, column 3) Type or
 namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


heres updated script. i looked but i dont see what its yelling about.
Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;

using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
 public class StableCommand
{
public static void Initialize() 
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
		} 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;
		}
		public static void Initialize() 
{ 
      			Server.Commands.Register( "Stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
{ 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}	
			



public static int GetMaxStabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class StableTarget : Target
{
				

			protected override void OnTarget( Mobile from, object targeted )
{
				if ( targeted is BaseCreature )
					m_Trainer.EndStable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void BeginStable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
		}
			else
{
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new StableTarget( this );
		}
		}

		}
		}
 

Malaperth

Wanderer
You need to put this:

Code:
		public StableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}

inside your StableTarget class
 

Emillio

Sorceror
Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (7 errors, 0 warnings)
 - Error: Scripts\Customs\montoyastable.cs: CS1520: (line 69, column 9) Class, s
truct, or interface method must have a return type
 - Error: Scripts\Customs\montoyastable.cs: CS1002: (line 69, column 36) ; expec
ted
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 69, column 72) Invalid
 token ')' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 71, column 13) Invalid
 token '=' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1519: (line 71, column 21) Invalid
 token ';' in class, struct, or interface member declaration
 - Error: Scripts\Customs\montoyastable.cs: CS1518: (line 86, column 8) Expected
 class, delegate, enum, interface, or struct
 - Error: Scripts\Customs\montoyastable.cs: CS1022: (line 107, column 3) Type or
 namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


its having a problem with the last few lines -

Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;
using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
 public class stableCommand
{
public static void Initialize() 
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
		} 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;
		}
		public static void Initialize() 
{ 
      			Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
{ 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		
			



public static int GetMaxStabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class StableTarget : Target
{
	public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}				

			protected override void OnTarget( Mobile from, object targeted )
{
				if ( targeted is BaseCreature )
					m_Trainer.EndStable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void BeginStable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
		}
			else
{
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new StableTarget( this );
		}
		}

		}
		}
 

Graiston

Wanderer
Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;
using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
 public class stableCommand
{
public static void Initialize() 
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
		} 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;
		}
		public static void Initialize() 
{ 
      			Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
{ 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		
			



public static int GetMaxStabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class StableTarget : Target
{
	public [COLOR="Red"]S[/COLOR]tableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}				

			protected override void OnTarget( Mobile from, object targeted )
{
				if ( targeted is BaseCreature )
					m_Trainer.EndStable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void BeginStable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
		}
			else
{
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new StableTarget( this );
		}
		}

		}
		}

The red part.....
 

Emillio

Sorceror
thanks

thanks both for helping me on this. im sorry but i don't see any red? :( I compared the two scripts, the one you posted and the one i had above and they seem completely identical. could you give me more of a clue? ty
 

Malaperth

Wanderer
C# is case sensitive. You define your StableTarget class with a capital S, but refer to it just after with stableTarget. They need to be the same.
 

Emillio

Sorceror
k down to 1

k now im down to 1 error! omg.

RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Customs\montoyastable.cs: CS0111: (line 25, column 26) Class '
Server.Factions.Scripts.Commands.stableCommand' already defines a member called
'stable_OnCommand' with the same parameter types
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


Here's revised script. (i noticed i had 2 initialize in same area, so i took one out.)

heres new code
Code:
using System;
using System.Collections; 
using Server; 
using Server.Items; 
using Server.Mobiles; 
using Server.Targeting;
using Server.ContextMenus;//not sure if i need these
using Server.Network;//not sure if i need these

namespace Server.Factions.Scripts.Commands 
{ 
 public class stableCommand
{
public static void Initialize() 
{ 
Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		
		} 
public static void stable_OnCommand( CommandEventArgs e ) 
{
		int m_stable;
		
      			Server.Commands.Register( "stable", AccessLevel.Player, new CommandEventHandler( stable_OnCommand ) ); 
    		} 
    		public static void stable_OnCommand( CommandEventArgs e ) 
{ 
				if(e.Length >= 1)
					e.Mobile.Target = new stableTarget( e.GetInt32(0) );
		}
		
			



public static int GetMaxstabled( Mobile from )
{
			double taming = from.Skills[SkillName.AnimalTaming].Value;
			double anlore = from.Skills[SkillName.AnimalLore].Value;
			double vetern = from.Skills[SkillName.Veterinary].Value;
			double sklsum = taming + anlore + vetern;

			int max;

			if ( sklsum >= 240.0 )
				max = 5;
			else if ( sklsum >= 200.0 )
				max = 4;
			else if ( sklsum >= 160.0 )
				max = 3;
			else
				max = 2;

			if ( taming >= 100.0 )
				max += (int)((taming - 90.0) / 10);

			if ( anlore >= 100.0 )
				max += (int)((anlore - 90.0) / 10);

			if ( vetern >= 100.0 )
				max += (int)((vetern - 90.0) / 10);

			return max;
		}
private class stableTarget : Target
{
	public stableTarget( int stable ) : base( -1, false, TargetFlags.None )
{
			m_stable = stable;
		}				

			protected override void OnTarget( Mobile from, object targeted )
{
				if ( targeted is BaseCreature )
					m_Trainer.Endstable( from, (BaseCreature)targeted );
				else if ( targeted == from )
					m_Trainer.SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
				else
					m_Trainer.SayTo( from, 1048053 ); // You can't stable that!
		}
		}


public void Beginstable( Mobile from )
{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( from.stabled.Count >= GetMaxstabled( from ) )
{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
		}
			else
{
				SayTo( from, 1042558 ); /* I charge 30 gold per pet for a real week's stable time.
										 * I will withdraw it from thy bank account.
										 * Which animal wouldst thou like to stable here?
										 */

				from.Target = new stableTarget( this );
		}
		}

		}
		}
ty for your help!
 

Emillio

Sorceror
nope

no, was away for a bit but im back. I'm not giving up.

Thats why i posted the error and script. what does it mean?
 
Top