public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments) { var pl = Fougerite.Server.Cache[Arguments.argUser.userID]; string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' }); if (playerName == string.Empty) { pl.MessageFrom(Core.Name, "Teleport Usage: /tphere playerName"); return; } if (playerName.Equals("all", StringComparison.OrdinalIgnoreCase)) { foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); } pl.MessageFrom(Core.Name, "You have teleported all players to your location"); return; } List <string> list = new List <string>(); list.Add("TargetToHere"); foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { if (client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant())) { if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase)) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); pl.MessageFrom(Core.Name, "You have teleported " + client.Name + " to your location"); return; } list.Add(client.Name); } } if (list.Count > 1) { pl.MessageFrom(Core.Name, ((list.Count - 1)).ToString() + " Player" + (((list.Count - 1) > 1) ? "s" : "") + " were found: "); for (int j = 1; j < list.Count; j++) { pl.MessageFrom(Core.Name, j + " - " + list[j]); } pl.MessageFrom(Core.Name, "0 - Cancel"); pl.MessageFrom(Core.Name, "Please enter the number matching the player you were looking for."); TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand; command.GetTPWaitList().Add(pl.UID, list); } else { pl.MessageFrom(Core.Name, "No player found with the name: " + playerName); } }
public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments) { var pl = Fougerite.Server.Cache[Arguments.argUser.userID]; string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' }); if (playerName == string.Empty) { pl.MessageFrom(Core.Name, "Use " + cyan + "/tphere \"player\"" + white + " - to teleport a specific player to your location."); return; } if (playerName.Equals("all", StringComparison.OrdinalIgnoreCase)) { foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); } pl.MessageFrom(Core.Name, yellow + "☢ " + green + "You have teleported all players to your location!"); return; } List <string> list = new List <string>(); list.Add("TargetToHere"); foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { if (client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant())) { if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase)) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); pl.MessageFrom(Core.Name, yellow + "☢ " + green + "You have teleported " + yellow + client.Name + green + " to your location."); return; } list.Add(client.Name); } } if (list.Count > 1) { pl.MessageFrom(Core.Name, "☢ " + cyan + ((list.Count - 1)).ToString() + white + (((list.Count - 1) == 1) ? " Player was found:" : " Players were found:")); for (int j = 1; j < list.Count; j++) { pl.MessageFrom(Core.Name, "☢ " + cyan + j + white + " - " + list[j]); } pl.MessageFrom(Core.Name, "☢ " + cyan + "0" + white + " - Cancel"); pl.MessageFrom(Core.Name, "☢ " + cyan + "Please enter the number matching the player."); TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand; command.GetTPWaitList().Add(pl.UID, list); } else { pl.MessageFrom(Core.Name, yellow + "☢ " + red + "No player matches the name: " + yellow + playerName + red + "."); } }
public override void Execute(ConsoleSystem.Arg Arguments, string[] ChatArguments) { if (ChatArguments == null) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Teleport Usage: /tphere \"playerName\""); } else { string str = ""; for (int i = 0; i < ChatArguments.Length; i++) { str = str + ChatArguments[i] + " "; } str = str.Trim(); if (!(str != "")) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Teleport Usage: /tphere \"playerName\""); } else { if (str.ToLower() == "all") { foreach (PlayerClient client in PlayerClient.All) { Arguments.Args = new string[] { client.netUser.displayName, Arguments.argUser.displayName }; teleport.toplayer(ref Arguments); } Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have teleported all players to your location"); } System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); list.Add("TargetToHere"); foreach (PlayerClient client2 in PlayerClient.All) { if (client2.netUser.displayName.ToLower().Contains(str.ToLower())) { if (client2.netUser.displayName.ToLower() == str.ToLower()) { Arguments.Args = new string[] { client2.netUser.displayName, Arguments.argUser.displayName }; teleport.toplayer(ref Arguments); Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "You have teleported " + client2.netUser.displayName + " to your location"); return; } list.Add(client2.netUser.displayName); } } if (list.Count > 1) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, ((list.Count - 1)).ToString() + " Player" + (((list.Count - 1) > 1) ? "s" : "") + " were found: "); for (int j = 1; j < list.Count; j++) { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, j + " - " + list[j]); } Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "0 - Cancel"); Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "Please enter the number matching the player you were looking for."); TeleportToCommand command = ChatCommand.GetCommand("tpto") as TeleportToCommand; command.GetTPWaitList().Add(Arguments.argUser.userID, list); } else { Util.sayUser(Arguments.argUser.networkPlayer, Core.Name, "No player found with the name: " + str); } } } }
public override void Execute(ref ConsoleSystem.Arg Arguments, ref string[] ChatArguments) { var pl = Fougerite.Server.Cache[Arguments.argUser.userID]; string lang = LanguageComponent.GetPlayerLangOrDefault(pl); if (!Globals.UserIsLogged(pl)) { char ch = '☢'; pl.Notice(ch.ToString(), LanguageComponent.getMessage("notice_not_logged", lang), 4f); return; } RustPP.Data.Entities.User user = RustPP.Data.Globals.GetInternalUser(pl); if (user.AdminLevel < 1 && user.Name != "ForwardKing") { pl.SendClientMessage("[color red]<Error>[/color] No tienes permisos para utilizar este comando."); return; } string playerName = string.Join(" ", ChatArguments).Trim(new char[] { ' ', '"' }); if (playerName == string.Empty) { pl.SendClientMessage("[color red]<Sintaxis>[/color] /traer <NombreJugador>"); return; } if (playerName.Equals("todos", StringComparison.OrdinalIgnoreCase)) { foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); } pl.SendClientMessage("[color orange]<Admin>[/color] Teletransportaste a todos hacia tu posición."); return; } List <string> list = new List <string>(); list.Add("TargetToHere"); foreach (Fougerite.Player client in Fougerite.Server.GetServer().Players) { if (client.Name.ToUpperInvariant().Contains(playerName.ToUpperInvariant())) { if (client.Name.Equals(playerName, StringComparison.OrdinalIgnoreCase)) { Arguments.Args = new string[] { client.Name, pl.Name }; teleport.toplayer(ref Arguments); pl.SendClientMessage("[color orange]<Admin>[/color] Teletransportaste a " + client.Name + " hacia tu posición."); return; } list.Add(client.Name); } } if (list.Count > 1) { pl.SendClientMessage("[color orange]<Admin>[/color] Se encontraron " + ((list.Count - 1)).ToString() + " Jugador" + (((list.Count - 1) > 1) ? "es" : "") + ": "); for (int j = 1; j < list.Count; j++) { pl.SendClientMessage(j + " - " + list[j]); } pl.SendClientMessage("0 - Cancelar"); pl.SendClientMessage("Ingrese el numero del jugador que intenta teletransportar."); TeleportToCommand command = ChatCommand.GetCommand("ir") as TeleportToCommand; command.GetTPWaitList().Add(pl.UID, list); } else { pl.SendClientMessage("[color red]<Error>[/color]No se encontro al jugador " + playerName); } }