JBob
Member
I'm having a hell of a time here.
This code is giving me some Errors.
CS0118: Line 86: 'Server.Gumps.AccountDBoxGump' is a 'type' but is used like a 'variable'
CS0103: Line 86: The name 'Buttons' does not exist in the current context
CS0118: Line 92: 'Server.Gumps.AccountDBoxGump' is a 'type' but is used like a 'variable'
CS0103: Line 92: The name 'Buttons' does not exist in the current context
The above section is in my OnDoubleClick.
I tried to do the similar thing in the actual gump button option.
But the above does not change any props in the Account Box.
Any suggestions/Help with this will be greatly appreciated.
I've been having troubles for a While with this.
This code is giving me some Errors.
CS0118: Line 86: 'Server.Gumps.AccountDBoxGump' is a 'type' but is used like a 'variable'
CS0103: Line 86: The name 'Buttons' does not exist in the current context
CS0118: Line 92: 'Server.Gumps.AccountDBoxGump' is a 'type' but is used like a 'variable'
CS0103: Line 92: The name 'Buttons' does not exist in the current context
Code:
player.SendGump(new AccountDBoxGump(player));
if (AccountDBoxGump(player).Buttons == Buttons.Okay)//Line 86
{
this.m_Account = from.Account.Username;
this.Hue = 0x482;
this.Name = from.Name.ToString() + "'s Account Deposit Box";
}
else if (AccountDBoxGump(player).Buttons == Buttons.Cancel)//Line 92
{
return;
}
The above section is in my OnDoubleClick.
I tried to do the similar thing in the actual gump button option.
Code:
public override void OnResponse(NetState sender, RelayInfo info)
{
AccountDepositBox adbox = new AccountDepositBox();
Mobile from = sender.Mobile;
switch(info.ButtonID)
{
case (int)Buttons.Okay:
{
Item[] Token = sender.Mobile.BankBox.FindItemsByType( typeof( Gold ) );
if ( sender.Mobile.BankBox.ConsumeTotal( typeof( Gold ), 50000 ) == true )
{
/*Dosnt Work*/ adbox.m_Account = sender.Mobile.Account.Username;//Will not change Chest props
/*Dosnt Work*/ adbox.Hue = 0x482;//Will not change Chest props
/*Dosnt Work*/ adbox.Name = sender.Mobile.Name.ToString() + "'s Account Deposit Box";//Will not change Chest props
Timer adbox_timer = new AccountDBoxTimer(adbox, sender.Mobile);
adbox_timer.Start();
//sender.Mobile.SendMessage("You successfully bought use of this Account Deposit Box!");
//sender.Mobile.SendMessage("This Account Deposit Box is now linked to all characters on this account.");
/*Debug Line*/ Console.WriteLine("Timer has Started");
}
else
{
//sender.Mobile.SendMessage( "You do not have enough gold in the bank to purchase the Account Deposit Box." );
/*Debug Line*/ Console.WriteLine("Nothing Will Happen");
}
break;
}
case (int)Buttons.Cancel:
{
sender.Mobile.SendMessage("You decide against buying use of this Account Deposit Box.");
/*Debug Line*/ Console.WriteLine("Answer No");
sender.Mobile.CloseGump(typeof(AccountDBoxGump));
break;
}
}
}
But the above does not change any props in the Account Box.
Any suggestions/Help with this will be greatly appreciated.
I've been having troubles for a While with this.