ExX
Member
I am trying to get a custom gump to load on login and I am getting an error I don't understand why. The mobile is already defined in the script as it's used by default to send a message so I just used the same definition to send a gump (making sure it was closed first to prevent duplicates). I am a little puzzled. Thanks for any help.
Here is the errors.
Errors:
+ Misc/LoginStats.cs:
CS7036: Line 27: There is no argument given that corresponds to the required formal parameter 'owner' of 'WelcomeGump.WelcomeGump(Mobile)'
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 the script.
Here is the errors.
Errors:
+ Misc/LoginStats.cs:
CS7036: Line 27: There is no argument given that corresponds to the required formal parameter 'owner' of 'WelcomeGump.WelcomeGump(Mobile)'
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 the script.
C#:
using System;
using Server.Network;
using Server.Engines.Quests;
using Server.Mobiles;
using System.Collections.Generic;
using System.Linq;
namespace Server.Misc
{
public class LoginStats
{
public static void Initialize()
{
// Register our event handler
EventSink.Login += new LoginEventHandler(EventSink_Login);
}
private static void EventSink_Login(LoginEventArgs args)
{
int userCount = NetState.Instances.Count;
int itemCount = World.Items.Count;
int mobileCount = World.Mobiles.Count;
Mobile m = args.Mobile;
m.CloseGump( typeof( WelcomeGump ) );
m.SendGump( new WelcomeGump() );
m.SendMessage("Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
args.Mobile.Name,
userCount == 1 ? "is" : "are",
userCount, userCount == 1 ? "" : "s",
itemCount, itemCount == 1 ? "" : "s",
mobileCount, mobileCount == 1 ? "" : "s");
if (m.IsStaff())
{
Server.Engines.Help.PageQueue.Pages_OnCalled(m);
}
}
}
}