| CODE |
using System; using System.IO; using System.Text; using System.Collections; using Server; using Server.Network; using Server.Guilds; using Server.Accounting; namespace Server.Misc { public class Online { public static void Initialize() { Server.Commands.Register( "Online", AccessLevel.Player, new CommandEventHandler( Online_OnCommand ) ); } private static void Online_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; int count=0; foreach ( NetState state in NetState.Instances ) { Mobile m = state.Mobile; if ( m != null ) { Guild g = m.Guild; string guild = ""; if ( g != null ) { if (m.GuildTitle != null ) { guild = " [" + m.GuildTitle + ", " + g.Abbreviation + "]"; } else { guild = " [" + g.Abbreviation + "]"; } } string region = m.Region.ToString(); if (region != "") { region=" à " + region; } else { region=" dans Britannia"; } if ( m.Hidden==false ) { count++; from.SendMessage( m.Name + guild + region); } } } from.SendMessage("Total: " + count); } } } |
| CODE |
using System; using System.IO; using System.Text; using System.Collections; using Server; using Server.Network; using Server.Accounting; namespace Server.Misc { public class EnLigne { public static void Initialize() { Server.Commands.Register( "Enligne", AccessLevel.Player, new CommandEventHandler( EnLigne_OnCommand ) ); } private static void EnLigne_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; int count=0; foreach ( NetState state in NetState.Instances ) { Mobile m = state.Mobile; if ( m != null ) { string region = m.Region.ToString(); if (region != "") { region=", " + region; } else { region=", Britannia"; } if (state.Mobile.AccessLevel < AccessLevel.GameMaster) { if ( m.Hidden==false ) { count++; from.SendMessage( m.Name + region); } } } } from.SendMessage("Total: " + count); } } } |