本文整理汇总了C#中MCPink.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于MCPink命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ExitChange
public void ExitChange(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
byte b = p.level.GetTile(x, y, z);
p.SendBlockchange(x, y, z, b);
portalPos bp = (portalPos)p.blockchangeObject;
foreach (portPos pos in bp.port)
{
DataTable Portals = MySQL.fillData("SELECT * FROM `Portals" + pos.portMapName + "` WHERE EntryX=" + (int)pos.x + " AND EntryY=" + (int)pos.y + " AND EntryZ=" + (int)pos.z);
Portals.Dispose();
if (Portals.Rows.Count == 0)
{
MySQL.executeQuery("INSERT INTO `Portals" + pos.portMapName + "` (EntryX, EntryY, EntryZ, ExitMap, ExitX, ExitY, ExitZ) VALUES (" + (int)pos.x + ", " + (int)pos.y + ", " + (int)pos.z + ", '" + p.level.name + "', " + (int)x + ", " + (int)y + ", " + (int)z + ")");
}
else
{
MySQL.executeQuery("UPDATE `Portals" + pos.portMapName + "` SET ExitMap='" + p.level.name + "', ExitX=" + (int)x + ", ExitY=" + (int)y + ", ExitZ=" + (int)z + " WHERE EntryX=" + (int)pos.x + " AND EntryY=" + (int)pos.y + " AND EntryZ=" + (int)pos.z);
}
//DB
if (pos.portMapName == p.level.name) p.SendBlockchange(pos.x, pos.y, pos.z, bp.type);
}
Player.SendMessage(p, "&3Exit" + Server.DefaultColor + " block placed");
if (p.staticCommands) { bp.port.Clear(); p.blockchangeObject = bp; p.Blockchange += new Player.BlockchangeEventHandler(EntryChange); }
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:29,代码来源:CmdPortal.cs
示例2: Help
public override void Help(Player p)
{
Player.SendMessage(p, "/cmdbind [command] [num] - Binds [command] to [num]");
Player.SendMessage(p, "[num] must be between 0 and 9");
Player.SendMessage(p, "Use with \"/[num]\" &b(example: /2)");
Player.SendMessage(p, "Use /cmdbind [num] to see stored commands.");
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:CmdCmdBind.cs
示例3: Use
public override void Use(Player p, string message)
{
if (message == "")
{
Command.all.Find("spawn");
return;
}
Player who = Player.Find(message);
if (who == null || (who.hidden && p.group.Permission < LevelPermission.Admin)) { Player.SendMessage(p, "There is no player \"" + message + "\"!"); return; }
if (p.level != who.level)
{
if(who.level.name.Contains("cMuseum"))
{
Player.SendMessage(p, "Player \"" + message + "\" is in a museum!");
return;
}
else
{
Command.all.Find("goto").Use(p, who.level.name);
}
}
if (p.level == who.level)
{
if (who.Loading)
{
Player.SendMessage(p, "Waiting for " + who.color + who.name + Server.DefaultColor + " to spawn...");
while (who.Loading) { }
}
while (p.Loading) { } //Wait for player to spawn in new map
unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:32,代码来源:CmdTp.cs
示例4: Blockchange1
public void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
CatchPos cpos = (CatchPos)p.blockchangeObject;
cpos.message = cpos.message.Replace("'", "\\'");
DataTable Messages = MySQL.fillData("SELECT * FROM `Messages" + p.level.name + "` WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
Messages.Dispose();
if (Messages.Rows.Count == 0)
{
MySQL.executeQuery("INSERT INTO `Messages" + p.level.name + "` (X, Y, Z, Message) VALUES (" + (int)x + ", " + (int)y + ", " + (int)z + ", '" + cpos.message + "')");
}
else
{
MySQL.executeQuery("UPDATE `Messages" + p.level.name + "` SET Message='" + cpos.message + "' WHERE X=" + (int)x + " AND Y=" + (int)y + " AND Z=" + (int)z);
}
Player.SendMessage(p, "Message block placed.");
p.level.Blockchange(p, x, y, z, cpos.type);
p.SendBlockchange(x, y, z, cpos.type);
if (p.staticCommands) p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:25,代码来源:CmdMessageBlock.cs
示例5: Blockchange2
public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type)
{
p.ClearBlockchange();
byte b = p.level.GetTile(x, y, z);
p.SendBlockchange(x, y, z, b);
CatchPos cpos = (CatchPos)p.blockchangeObject;
Level.Zone Zn;
Zn.smallX = Math.Min(cpos.x, x);
Zn.smallY = Math.Min(cpos.y, y);
Zn.smallZ = Math.Min(cpos.z, z);
Zn.bigX = Math.Max(cpos.x, x);
Zn.bigY = Math.Max(cpos.y, y);
Zn.bigZ = Math.Max(cpos.z, z);
Zn.Owner = cpos.Owner;
p.level.ZoneList.Add(Zn);
//DB
MySQL.executeQuery("INSERT INTO `Zone" + p.level.name + "` (SmallX, SmallY, SmallZ, BigX, BigY, BigZ, Owner) VALUES (" + Zn.smallX + ", " + Zn.smallY + ", " + Zn.smallZ + ", " + Zn.bigX + ", " + Zn.bigY + ", " + Zn.bigZ + ", '" + Zn.Owner + "')");
//DB
Player.SendMessage(p, "Added zone for &b" + cpos.Owner);
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:25,代码来源:CmdZone.cs
示例6: Use
public override void Use(Player p, string message)
{
if (message != "") { Help(p); return; }
p.painting = !p.painting; if (p.painting) { Player.SendMessage(p, "Painting mode: &aON" + Server.DefaultColor + "."); }
else { Player.SendMessage(p, "Painting mode: &cOFF" + Server.DefaultColor + "."); }
p.BlockAction = 0;
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:CmdPaint.cs
示例7: Use
public override void Use(Player p, string message)
{
if (message != "") { Help(p); return; }
p.deleteMode = !p.deleteMode;
Player.SendMessage(p, "Delete mode: &a" + p.deleteMode);
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:CmdDelete.cs
示例8: Help
public override void Help(Player p)
{
Player.SendMessage(p, "/save - Saves the level you are currently in");
Player.SendMessage(p, "/save all - Saves all loaded levels.");
Player.SendMessage(p, "/save <map> - Saves the specified map.");
Player.SendMessage(p, "/save <map> <name> - Backups the map with a given restore name");
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:CmdSave.cs
示例9: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
bool stealth = false;
if (message[0] == '#')
{
message = message.Remove(0, 1).Trim();
stealth = true;
Server.s.Log("Stealth joker attempted");
}
Player who = Player.Find(message);
if (who == null)
{
Player.SendMessage(p, "Could not find player.");
return;
}
// else if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot joker someone of equal or greater rank."); return; }
if (!who.joker)
{
who.joker = true;
if (stealth) { Player.GlobalMessageOps(who.color + who.name + Server.DefaultColor + " is now STEALTH joker'd. "); return; }
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " is now a &aJ&bo&ck&5e&9r" + Server.DefaultColor + ".", false);
}
else
{
who.joker = false;
if (stealth) { Player.GlobalMessageOps(who.color + who.name + Server.DefaultColor + " is now STEALTH Unjoker'd. "); return; }
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " is no longer a &aJ&bo&ck&5e&9r" + Server.DefaultColor + ".", false);
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:32,代码来源:CmdJoker.cs
示例10: Use
public override void Use(Player p, string message)
{
Level foundLevel;
if (message == "") { foundLevel = p.level; }
else foundLevel = Level.Find(message);
if (foundLevel == null) { Player.SendMessage(p, "Could not find specified level."); return; }
Player.SendMessage(p, "&b" + foundLevel.name + Server.DefaultColor + ": Width=" + foundLevel.width.ToString() + " Height=" + foundLevel.depth.ToString() + " Depth=" + foundLevel.height.ToString());
switch (foundLevel.physics)
{
case 0: Player.SendMessage(p, "Physics are &cOFF" + Server.DefaultColor + " on &b" + foundLevel.name); break;
case 1: Player.SendMessage(p, "Physics are &aNormal" + Server.DefaultColor + " on &b" + foundLevel.name); break;
case 2: Player.SendMessage(p, "Physics are &aAdvanced" + Server.DefaultColor + " on &b" + foundLevel.name); break;
case 3: Player.SendMessage(p, "Physics are &aHardcore" + Server.DefaultColor + " on &b" + foundLevel.name); break;
case 4: Player.SendMessage(p, "Physics are &aInstant" + Server.DefaultColor + " on &b" + foundLevel.name); break;
}
try
{
Player.SendMessage(p, "Build rank = " + Group.findPerm(foundLevel.permissionbuild).color + Group.findPerm(foundLevel.permissionbuild).trueName + Server.DefaultColor + " : Visit rank = " + Group.findPerm(foundLevel.permissionvisit).color + Group.findPerm(foundLevel.permissionvisit).trueName);
} catch (Exception e) { Server.ErrorLog(e); }
if (Directory.Exists(@Server.backupLocation + "/" + foundLevel.name))
{
int latestBackup = Directory.GetDirectories(@Server.backupLocation + "/" + foundLevel.name).Length;
Player.SendMessage(p, "Latest backup: &a" + latestBackup + Server.DefaultColor + " at &a" + Directory.GetCreationTime(@Server.backupLocation + "/" + foundLevel.name + "/" + latestBackup).ToString("yyyy-MM-dd HH:mm:ss")); // + Directory.GetCreationTime(@Server.backupLocation + "/" + latestBackup + "/").ToString("yyyy-MM-dd HH:mm:ss"));
}
else
{
Player.SendMessage(p, "No backups for this map exist yet.");
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:35,代码来源:CmdMapInfo.cs
示例11: Help
public override void Help(Player p)
{
Player.SendMessage(p, "/setrank <player> <rank> <yay> - Sets or returns a players rank.");
Player.SendMessage(p, "You may use /rank as a shortcut");
Player.SendMessage(p, "Valid Ranks are: " + Group.concatList(true, true));
Player.SendMessage(p, "<yay> is a celebratory message");
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:CmdSetRank.cs
示例12: Use
public override void Use(Player p, string message)
{
if (message != "list")
{
if (p.joker)
{
message = "";
}
if (!Server.afkset.Contains(p.name))
{
Server.afkset.Add(p.name);
if (p.muted)
{
message = "";
}
Player.GlobalMessage("-" + p.color + p.name + Server.DefaultColor + "- is AFK " + message);
IRCBot.Say(p.name + " is AFK " + message);
return;
}
else
{
Server.afkset.Remove(p.name);
Player.GlobalMessage("-" + p.color + p.name + Server.DefaultColor + "- is no longer AFK");
IRCBot.Say(p.name + " is no longer AFK");
return;
}
}
else
{
foreach (string s in Server.afkset) Player.SendMessage(p, s);
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:33,代码来源:CmdAfk.cs
示例13: Use
public override void Use(Player p, string message)
{
string[] parameters = message.Split(' ');
ushort[] click = p.lastClick;
if (message.IndexOf(' ') != -1)
{
if (parameters.Length != 3)
{
Help(p);
return;
}
else
{
for (int value = 0; value < 3; value++)
{
if (parameters[value].ToLower() == "x" || parameters[value].ToLower() == "y" || parameters[value].ToLower() == "z")
click[value] = p.lastClick[value];
else if (isValid(parameters[value], value, p))
click[value] = ushort.Parse(parameters[value]);
else
{
Player.SendMessage(p, "\"" + parameters[value] + "\" was not valid");
return;
}
}
}
}
p.manualChange(click[0], click[1], click[2], 0, Block.rock);
Player.SendMessage(p, "Clicked &b(" + click[0] + ", " + click[1] + ", " + click[2] + ")");
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:32,代码来源:CmdClick.cs
示例14: highlightStuff
public void highlightStuff(string[] fileContent, Int64 seconds, Player p)
{
Player.UndoPos Pos;
for (int i = fileContent.Length / 7; i >= 0; i--)
{
try
{
if (Convert.ToDateTime(fileContent[(i * 7) + 4].Replace('&', ' ')).AddSeconds(seconds) >= DateTime.Now)
{
Level foundLevel = Level.Find(fileContent[i * 7]);
if (foundLevel != null && foundLevel == p.level)
{
Pos.mapName = foundLevel.name;
Pos.x = Convert.ToUInt16(fileContent[(i * 7) + 1]);
Pos.y = Convert.ToUInt16(fileContent[(i * 7) + 2]);
Pos.z = Convert.ToUInt16(fileContent[(i * 7) + 3]);
Pos.type = foundLevel.GetTile(Pos.x, Pos.y, Pos.z);
if (Pos.type == Convert.ToByte(fileContent[(i * 7) + 6]) || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
{
if (Pos.type == Block.air || Block.Convert(Pos.type) == Block.water || Block.Convert(Pos.type) == Block.lava)
p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.red);
else p.SendBlockchange(Pos.x, Pos.y, Pos.z, Block.green);
}
}
}
else break;
}
catch { }
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:33,代码来源:CmdHighlight.cs
示例15: 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:MinedroidFTW,项目名称:MCPink,代码行数:7,代码来源:FindReference.cs
示例16: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Player who = Player.Find(message);
if (who == null)
{
Player.SendMessage(p, "Could not find player specified");
return;
}
ushort currentX = (ushort)(who.pos[0] / 32);
ushort currentY = (ushort)(who.pos[1] / 32);
ushort currentZ = (ushort)(who.pos[2] / 32);
ushort foundHeight = 0;
for (ushort yy = currentY; yy <= 1000; yy++)
{
if (!Block.Walkthrough(p.level.GetTile(currentX, yy, currentZ)) && p.level.GetTile(currentX, yy, currentZ) != Block.Zero)
{
foundHeight = (ushort)(yy - 1);
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped into the roof by " + p.color + p.name);
break;
}
}
if (foundHeight == 0)
{
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped sky high by " + p.color + p.name);
foundHeight = 1000;
}
unchecked { who.SendPos((byte)-1, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]); }
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:35,代码来源:CmdSlap.cs
示例17: Use
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
Player who = Player.Find(message);
if (who != null)
{
if (who.voice)
{
who.voice = false;
Player.SendMessage(p, "Removing voice status from " + who.name);
who.SendMessage("Your voice status has been revoked.");
who.voicestring = "";
}
else
{
who.voice = true;
Player.SendMessage(p, "Giving voice status to " + who.name);
who.SendMessage("You have received voice status.");
who.voicestring = "&f+";
}
}
else
{
Player.SendMessage(p, "There is no player online named \"" + message + "\"");
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:26,代码来源:CmdVoice.cs
示例18: Use
public override void Use(Player p, string message)
{
if (message == "" || message.IndexOf(' ') == -1) { Help(p); return; }
Level foundLevel = Level.Find(message.Split(' ')[0]);
string newName = message.Split(' ')[1];
if (File.Exists("levels/" + newName)) { Player.SendMessage(p, "Level already exists."); return; }
if (foundLevel == Server.mainLevel) { Player.SendMessage(p, "Cannot rename the main level."); return; }
if (foundLevel != null) foundLevel.Unload();
try
{
File.Move("levels/" + foundLevel.name + ".lvl", "levels/" + newName + ".lvl");
try
{
File.Move("levels/level properties/" + foundLevel.name + ".properties", "levels/level properties/" + newName + ".properties");
}
catch { }
try
{
File.Move("levels/level properties/" + foundLevel.name, "levels/level properties/" + newName + ".properties");
}
catch { }
MySQL.executeQuery("RENAME TABLE `Block" + foundLevel.name.ToLower() + "` TO `Block" + newName.ToLower() +
"`, `Portals" + foundLevel.name.ToLower() + "` TO `Portals" + newName.ToLower() +
"`, `Messages" + foundLevel.name.ToLower() + "` TO Messages" + newName.ToLower() +
", `Zone" + foundLevel.name.ToLower() + "` TO `Zone" + newName.ToLower() + "`");
Player.GlobalMessage("Renamed " + foundLevel.name + " to " + newName);
}
catch (Exception e) { Player.SendMessage(p, "Error when renaming."); Server.ErrorLog(e); }
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:34,代码来源:CmdRenameLvl.cs
示例19: Use
public override void Use(Player p, string message)
{
if (message.ToLower() == "empty")
{
Boolean Empty = true;
foreach (Level l in Server.levels)
{
Empty = true;
Player.players.ForEach(delegate(Player pl)
{
if (pl.level == l) Empty = false;
});
if (Empty == true && l.unload)
{
l.Unload();
return;
}
}
Player.SendMessage(p, "No levels were empty.");
return;
}
Level level = Level.Find(message);
if (level != null)
{
if (!level.Unload()) Player.SendMessage(p, "You cannot unload the main level.");
return;
}
Player.SendMessage(p, "There is no level \"" + message + "\" loaded.");
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:34,代码来源:CmdUnload.cs
示例20: Use
public override void Use(Player p, string message)
{
if ((message.ToLower() == "create" || message.ToLower() == "") && p != null)
{
p.level.jailx = p.pos[0]; p.level.jaily = p.pos[1]; p.level.jailz = p.pos[2];
p.level.jailrotx = p.rot[0]; p.level.jailroty = p.rot[1];
Player.SendMessage(p, "Set Jail point.");
}
else
{
Player who = Player.Find(message);
if (who != null)
{
if (!who.jailed)
{
if (p != null) if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot jail someone of equal or greater rank."); return; }
if (who.level != p.level) Command.all.Find("goto").Use(who, p.level.name);
Player.GlobalDie(who, false);
Player.GlobalSpawn(who, p.level.jailx, p.level.jaily, p.level.jailz, p.level.jailrotx, p.level.jailroty, true);
who.jailed = true;
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " was &8jailed", false);
}
else
{
who.jailed = false;
Player.GlobalChat(null, who.color + who.name + Server.DefaultColor + " was &afreed" + Server.DefaultColor + " from jail", false);
}
}
else
{
Player.SendMessage(p, "Could not find specified player.");
}
}
}
开发者ID:MinedroidFTW,项目名称:MCPink,代码行数:34,代码来源:CmdJail.cs
注:本文中的MCPink.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论