public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments) { string displayName; string str2 = ""; for (int i = 0; i < ChatArguments.Length; i++) { str2 = str2 + ChatArguments[i] + " "; } str2 = str2.Trim(); if (str2 == "") { displayName = Arguments.argUser.displayName; } else { if (!Administrator.IsAdmin(Arguments.argUser.userID)) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Only administrators can ask for another player's location."); return; } displayName = str2; } foreach (PlayerClient client in PlayerClient.FindAllWithString(displayName)) { string strValue = string.Concat(new object[] { "Location: X: ", (int)client.lastKnownPosition.x, " Y: ", (int)client.lastKnownPosition.y, " Z: ", (int)client.lastKnownPosition.z }); Arguments.ReplyWith(strValue); Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, string.Concat(new object[] { (str2 == "") ? "Your" : (displayName + "'s"), " Location Is: X: ", (int)client.lastKnownPosition.x, " Y: ", (int)client.lastKnownPosition.y, " Z: ", (int)client.lastKnownPosition.z })); } }
public static void location(ref ConsoleSystem.Arg arg) { if (config.GetSetting("Commands", "location") == "false") { API.sayUser(arg.argUser.networkPlayer, "This feature has been disabled on this server"); return; } string partialNameOrIDInt = arg.argUser.displayName; foreach (PlayerClient playerClient in PlayerClient.FindAllWithString(partialNameOrIDInt)) { string s = "Location: X: " + (int)playerClient.lastKnownPosition.x + " Y: " + (int)playerClient.lastKnownPosition.y + " Z: " + (int)playerClient.lastKnownPosition.z; arg.ReplyWith(s); API.sayUser(arg.argUser.networkPlayer, "Your Location Is: X: " + (int)playerClient.lastKnownPosition.x + " Y: " + (int)playerClient.lastKnownPosition.y + " Z: " + (int)playerClient.lastKnownPosition.z); } }
public void OutputList(ref ConsoleSystem.Arg arg) { ArrayList list = new ArrayList(); ArrayList list2 = new ArrayList(); foreach (Friend friend in this) { PlayerClient client; try { client = EnumerableToArray.ToArray <PlayerClient>(PlayerClient.FindAllWithString(friend.GetUserID().ToString()))[0]; } catch { list2.Add(friend.GetDisplayName()); continue; } list.Add(client.netUser.displayName + " (Online)"); friend.SetDisplayName(client.netUser.displayName); } if (list.Count > 0) { Util.sayUser(arg.argUser.networkPlayer, Core.Name, string.Concat(new object[] { "You currently have ", list.Count, " friend", (list.Count > 1) ? "s" : "", " online." })); } else { Util.sayUser(arg.argUser.networkPlayer, Core.Name, "None of your friend is playing right now."); } foreach (string str in list2) { list.Add(str); } int num = 0; int num2 = 0; string str2 = ""; foreach (string str3 in list) { num2++; if (num2 >= 60) { num = 0; break; } str2 = str2 + str3 + ", "; if (num == 6) { num = 0; Util.sayUser(arg.argUser.networkPlayer, Core.Name, str2.Substring(0, str2.Length - 3)); str2 = ""; } else { num++; } } if (num != 0) { Util.sayUser(arg.argUser.networkPlayer, Core.Name, str2.Substring(0, str2.Length - 3)); } }