|Sutats|
Initiate
I'm in the process of updating a mass amount of old RUO 1.1 scripts and when I get the error "namespace name 'CommandEventArgs' could not be found" I'm supposed to put 'using Server.Commands;' because namespace Server.Scripts.Commands is outdated. But should I be placing 'using Server.Commands;' where where 'namespace Server.Scripts.commands;' is or should I put it under 'using System;' 'using Server;'
If I do put it under 'using Server;' then should I be replacing 'namespace Server.Scripts.Commands' with 'namespace Server.Misc' or something along those lines?
Code:
using Server;
using Server.Items; <------Here?
using Server.Commands;
namespace Server.Scripts.Commands <---------- Or here?
{
public class CountShardGold
{
public static void Initialize()
{
Server.Commands.Register( "CountShardGold", AccessLevel.Administrator, new CommandEventHandler( CountShardGold_OnCommand ) );
}
[Usage( "CountShardGold" )]
[Description( "Counts money on shard." )]
private static void CountShardGold_OnCommand( CommandEventArgs e )
{
Mobile from = e.Mobile;
if ( from == null )
return;
long gold = 0;
foreach( Item item in World.Items.Values )
{
if ( item is Gold )
gold += item.Amount;
else if ( item is BankCheck )
gold += ((BankCheck)item).Worth;
}
from.SendMessage( "Gold on shard: {0}gp.", gold );
}
}
}
If I do put it under 'using Server;' then should I be replacing 'namespace Server.Scripts.Commands' with 'namespace Server.Misc' or something along those lines?