本文整理汇总了C#中MCGalaxy.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于MCGalaxy命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: placeBlock
public static void placeBlock(Level l, Player p, ushort x, ushort y, ushort z, byte type)
{
if (p == null)
l.Blockchange(x, y, z, type);
else
l.Blockchange(p, x, y, z, type);
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:7,代码来源:FindReference.cs
示例2: player
public player(Player pl)
{
p = pl;
OldColor = pl.color;
OldTitle = pl.title;
OldTitleColor = pl.titlecolor;
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:7,代码来源:TntWarsGame.cs
示例3: isOnTeam
/// <summary>
/// Checks to see if the player is on this team
/// </summary>
/// <param name="p">The player</param>
/// <returns>If true, then that player is on the team. Otherwise that player isnt</returns>
public bool isOnTeam(Player p)
{
if (members.IndexOf(p) != -1)
return true;
else
return false;
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:12,代码来源:Auto_CTF.cs
示例4: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
int pos = message.IndexOf(' ');
Player who = Player.Find(message.Split(' ')[0]);
if (who == null) { Player.SendMessage(p, "Could not find player."); return; }
if (p != null && who.group.Permission > p.group.Permission)
{
Player.SendMessage(p, "Cannot change the nick of someone of greater rank");
return;
}
string query;
string newName = "";
if (message.Split(' ').Length > 1) newName = message.Substring(pos + 1);
else
{
who.DisplayName = who.name;
Player.GlobalChat(who, who.color + who.prefix + who.DisplayName + "&g has reverted their nick to their original name.", false);
Player.GlobalDie(p, false);
Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
return;
}
if (newName.Length > 60) { Player.SendMessage(p, "Nick must be under 60 letters."); return; }
if (newName != "") Player.GlobalChat(who, who.color + who.DisplayName + "&g has changed their nick to " + newName + "&g.", false);
who.DisplayName = newName;
Player.GlobalDie(who, false);
Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
PlayerDB.Save(who);
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:32,代码来源:CmdNick.cs
示例5: writeLetter
public static ushort writeLetter(Level l, Player p, char c, ushort x, ushort y, ushort z, byte b, int direction)
{
if( (int)c >= 256 || letters[(int)c] == null ) {
Player.SendMessage(p, "\"" + c + "\" is currently not supported. Space left");
if (direction == 0) x += 4; else if (direction == 1) x -= 4;
else if (direction == 2) z += 4; else z -= 4;
} else {
byte[] flags = letters[(int)c];
for( int i = 0; i < flags.Length; i++ ) {
byte yUsed = flags[i];
for (int j = 0; j < 8; j++) {
if ((yUsed & (1 << j)) == 0) continue;
placeBlock(l, p, x, (ushort)(y + j), z, b);
}
if (direction == 0) x++; else if (direction == 1) x--;
else if (direction == 2) z++; else z--;
}
}
if (direction == 0) return (ushort)(x + 1);
else if (direction == 1) return (ushort)(x - 1);
else if (direction == 2) return (ushort)(z + 1);
else return (ushort)(z - 1);
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:26,代码来源:FindReference.cs
示例6: Load
public static bool Load( Player p ) {
if ( File.Exists( "players/" + p.name + "DB.txt" ) ) {
foreach ( string line in File.ReadAllLines( "players/" + p.name + "DB.txt" ) ) {
if ( !string.IsNullOrEmpty( line ) && !line.StartsWith( "#" ) ) {
string key = line.Split( '=' )[0].Trim();
string value = line.Split( '=' )[1].Trim();
string section = "nowhere yet...";
try {
switch ( key.ToLower() ) {
case "nick":
p.DisplayName = value;
section = key;
break;
}
} catch(Exception e) {
Server.s.Log( "Loading " + p.name + "'s EXP database failed at section: " + section );
Server.ErrorLog( e );
}
p.timeLogged = DateTime.Now;
}
}
p.SetPrefix();
return true;
} else {
Save( p );
return false;
}
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:31,代码来源:PlayerDB.cs
示例7: Save
public static void Save( Player p ) {
StreamWriter sw = new StreamWriter( File.Create( "players/" + p.name + "DB.txt" ) );
sw.WriteLine ("Nick = " + p.DisplayName );
sw.Flush();
sw.Close();
sw.Dispose();
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:7,代码来源:PlayerDB.cs
示例8: Register
/// <summary>
/// Register this event
/// </summary>
/// <param name="method">This is the delegate that will get called when this event occurs</param>
/// <param name="priority">The priority (imporantce) of this call</param>
/// <param name="plugin">The plugin object that is registering the event</param>
/// <param name="bypass">Register more than one of the same event</param>
public static void Register(Player.OnPlayerChat method, Priority priority, Plugin plugin, bool bypass = false)
{
if (Find(plugin) != null)
if (!bypass)
throw new Exception("The user tried to register 2 of the same event!");
events.Add(new OnPlayerChatEvent(method, priority, plugin));
Organize();
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:15,代码来源:OnPlayerChatEvent.cs
示例9: Addblock
public static void Addblock(Player p, ushort x, ushort y, ushort z, byte type, byte extType = 0) {
int index = p.level.PosToInt(x, y, z);
if (index < 0) return;
block item;
item.p = p; item.index = index;
item.type = type; item.extType = extType;
p.level.blockqueue.Add(item);
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:9,代码来源:BlockQueue.cs
示例10: Perform
public override void Perform(ushort x1, ushort y1, ushort z1, ushort x2,
ushort y2, ushort z2, Player p, Level lvl, Brush brush) {
for (ushort y = y1; y <= y2; y++)
for (ushort z = z1; z <= z2; z++)
for (ushort x = x1; x <= x2; x++)
{
PlaceBlock(p, lvl, x, y, z, brush);
}
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:9,代码来源:CuboidDrawOp.cs
示例11: Create
public static void Create(string waypoint, Player p) {
Waypoint wp = new Waypoint();
wp.x = p.pos[0]; wp.y = p.pos[1]; wp.z = p.pos[2];
wp.rotx = p.rot[0]; wp.roty = p.rot[1];
wp.name = waypoint;
wp.lvlname = p.level.name;
p.Waypoints.Add(wp);
Save();
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:9,代码来源:Waypoint.cs
示例12: CanDraw
public bool CanDraw(ushort x1, ushort y1, ushort z1, ushort x2, ushort y2, ushort z2,
Player p, out int affected) {
affected = GetBlocksAffected(p.level, x1, y1, z1, x2, y2, z2);
if (affected > p.group.maxBlocks) {
Player.SendMessage(p, "You tried to draw " + affected + " blocks.");
Player.SendMessage(p, "You cannot draw more than " + p.group.maxBlocks + ".");
return false;
}
return true;
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:10,代码来源:DrawOp.cs
示例13: GlobalChatWorld
public static void GlobalChatWorld(Player from, string message, bool showname) {
if ( showname ) {
message = "<World>" + from.color + from.voicestring + from.color + from.prefix + from.name + ": &f" + message;
}
Player.players.ForEach(
delegate(Player p) {
if ( p.level.worldChat && p.Chatroom == null )
SendGlobalMessage(p, from, message);
});
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:10,代码来源:Chat.cs
示例14: Call
public static void Call(Player p, byte[] rot)
{
events.ForEach(delegate(PlayerRotateEvent p1)
{
try
{
p1.method(p, rot);
}
catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the PlayerRotate Event!"); Server.ErrorLog(e); }
});
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:PlayerRotateEvent.cs
示例15: Call
public static void Call(Player p, Group newrank)
{
events.ForEach(delegate(OnPlayerRankSetEvent p1)
{
try
{
p1.method(p, newrank);
}
catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the LevelUnload Event!"); Server.ErrorLog(e); }
});
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:OnPlayerRankSetEvent.cs
示例16: Perform
public override void Perform(ushort x1, ushort y1, ushort z1, ushort x2,
ushort y2, ushort z2, Player p, Level lvl, Brush brush) {
while (true) {
baseOp.Perform(x1, y1, z1, x2, y1, z2, p, lvl, brush);
if (y1 >= lvl.Height || Math.Abs(x2 - x1) <= 1 || Math.Abs(z2 - z1) <= 1)
break;
x1++; x2--;
z1++; z2--;
y1 = (ushort)(y1 + yDir);
}
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:11,代码来源:PyramidDrawOp.cs
示例17: Call
public static void Call(Player p, string mysqlcommand)
{
events.ForEach(delegate(OnMySQLSaveEvent p1)
{
try
{
p1.method(p, mysqlcommand);
}
catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the MySQLSave Event!"); Server.ErrorLog(e); }
});
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:OnMySQLSaveEvent.cs
示例18: Use
public override void Use(Player p, string message)
{
Player who = Player.Find(message);
if (who == null || who.hidden) { Player.SendMessage(p, "Could not find specified player!"); return; }
else
{
string msg = String.Format("the {0}Console [&a{1}{0}]", Server.DefaultColor, Server.ZallState);
string giver = (p == null) ? msg : p.color + p.DisplayName;
Player.GlobalMessage(who.color + who.DisplayName + Server.DefaultColor + " was hugged by " + giver);
}
}
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:11,代码来源:CmdHug.cs
示例19: Call
public static void Call(Player p, string message)
{
events.ForEach(delegate(OnPlayerChatEvent p1)
{
try
{
p1.method(p, message);
}
catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the PlayerChat Event!"); Server.ErrorLog(e); }
});
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:OnPlayerChatEvent.cs
示例20: Call
public static void Call(Player p, ushort x, ushort y, ushort z, byte type)
{
events.ForEach(delegate(OnBlockChangeEvent p1)
{
try
{
p1.method(p, x, y, z, type);
}
catch (Exception e) { Server.s.Log("The plugin " + p1.plugin.name + " errored when calling the PlayerBlockChange Event!"); Server.ErrorLog(e); }
});
}
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:OnBlockChangeEvent.cs
注:本文中的MCGalaxy.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论