using System;
using System.Text;
using System.Collections;
using Server;
using Server.Network;
using Server.Guilds;
using Server.Mobiles;
namespace Server.Scripts.Commands
{
public class GUILDC
{
private static int usercount;
public static void Initialize()
{
Server.Commands.Register( "g", AccessLevel.Player, new CommandEventHandler( GUILDC_OnCommand ) );
}
[Usage( "g [<text>|list]" )]
[Description( "Guildinizdeki online kisilere mesag atmanizi saglar." )]
private static void GUILDC_OnCommand( CommandEventArgs e )
{
switch( e.ArgString.ToLower() )
{
case "list":
List ( e.Mobile );
break;
default:
Msg ( e );
break;
}
}
private static void List( Mobile g )
{
usercount = 0;
Guild GuildC = (Guild)(g.Guild);
if ( GuildC == null )
{
g.SendMessage( "Bir guildiniz yok!" );
}
else
{
foreach ( NetState state in NetState.Instances )
{
Mobile m = state.Mobile;
if ( m != null && GuildC.IsMember( m ) )
{
usercount++;
}
}
if (usercount == 0)
{
g.SendMessage( "Guildinizde sizden baska online player yok." );
}
else
{
g.SendMessage( "{0} kisi{0} suanda online.", usercount, usercount == 1 ? "" : "s");
}
g.SendMessage ("Online Listesi:" );
foreach ( NetState state in NetState.Instances )
{
Mobile m = state.Mobile;
if ( m != null && GuildC.IsMember( m ) )
{
string region = m.Region.ToString();
if (region == "")
{
region = "Sosaria";
}
g.SendMessage( "{0}", m.Name);
}
}
}
}
private static void Msg( CommandEventArgs e )
{
Mobile from = e.Mobile;
Guild GuildC = (Guild)(from.Guild);
if ( GuildC == null )
{
from.SendMessage( "Bir guildiniz yok!" );
}
else
{
foreach ( NetState state in NetState.Instances )
{
Mobile m = state.Mobile;
if ( m != null && GuildC.IsMember( m ) )
{
m.SendMessage( 0x2C, String.Format( "{0} [{1}]: {2}", GuildC.Abbreviation, from.Name, e.ArgString ) );
}
}
}
}
}
}
Total votes: 0
Ultima Online 1 hafta önce
Sunucular 2 hafta önce
Duyurular 3 hafta önce
Sphere Scripting 4 hafta önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Diğer Oyunlar 1 ay önce
Sunucular 1 ay önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Ultima Online 2 ay önce
Ultima Online 2 ay önce
2024-10-31 22:47
2024-10-14 17:45
2024-09-26 14:21
2024-07-08 22:50
2024-07-08 22:34
2024-06-19 22:05
2024-06-01 02:19
2024-05-31 21:17
Yorumlar (0)