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); } } } }
private static void InitializeCommands() { ChatCommand.AddCommand("/about", new AboutCommand()); ChatCommand.AddCommand("/addfriend", new AddFriendCommand()); AddAdminCommand command = new AddAdminCommand(); command.AdminFlags = "CanAddAdmin"; ChatCommand.AddCommand("/addadmin", command); AddFlagCommand command2 = new AddFlagCommand(); command2.AdminFlags = "CanAddFlags"; ChatCommand.AddCommand("/addflag", command2); AnnounceCommand command3 = new AnnounceCommand(); command3.AdminFlags = "CanAnnounce"; ChatCommand.AddCommand("/announce", command3); BanCommand command4 = new BanCommand(); command4.AdminFlags = "CanBan"; ChatCommand.AddCommand("/ban", command4); ChatCommand.AddCommand("/friends", new FriendsCommand()); GetFlagsCommand command5 = new GetFlagsCommand(); command5.AdminFlags = "CanGetFlags"; ChatCommand.AddCommand("/getflags", command5); GiveItemCommand command6 = new GiveItemCommand(); command6.AdminFlags = "CanGiveItem"; ChatCommand.AddCommand("/give", command6); GodModeCommand command7 = new GodModeCommand(); command7.AdminFlags = "CanGodMode"; ChatCommand.AddCommand("/god", command7); ChatCommand.AddCommand("/help", new HelpCommand()); ChatCommand.AddCommand("/history", new HistoryCommand()); SpawnItemCommand command8 = new SpawnItemCommand(); command8.AdminFlags = "CanSpawnItem"; ChatCommand.AddCommand("/i", command8); InstaKOCommand command9 = new InstaKOCommand(); command9.AdminFlags = "CanInstaKO"; ChatCommand.AddCommand("/instako", command9); KickCommand command10 = new KickCommand(); command10.AdminFlags = "CanKick"; ChatCommand.AddCommand("/kick", command10); KillCommand command11 = new KillCommand(); command11.AdminFlags = "CanKill"; ChatCommand.AddCommand("/kill", command11); LoadoutCommand command12 = new LoadoutCommand(); command12.AdminFlags = "CanLoadout"; ChatCommand.AddCommand("/loadout", command12); ChatCommand.AddCommand("/motd", new MOTDCommand()); MuteCommand command13 = new MuteCommand(); command13.AdminFlags = "CanMute"; ChatCommand.AddCommand("/mute", command13); ChatCommand.AddCommand("/location", new LocationCommand()); ChatCommand.AddCommand("/ping", new PingCommand()); ChatCommand.AddCommand("/players", new PlayersCommand()); ChatCommand.AddCommand("/pm", new PrivateMessagesCommand()); ReloadCommand command14 = new ReloadCommand(); command14.AdminFlags = "CanReload"; ChatCommand.AddCommand("/reload", command14); RemoveAdminCommand command15 = new RemoveAdminCommand(); command15.AdminFlags = "CanDeleteAdmin"; ChatCommand.AddCommand("/unadmin", command15); ChatCommand.AddCommand("/r", new ReplyCommand()); ChatCommand.AddCommand("/rules", new RulesCommand()); SaveAllCommand command16 = new SaveAllCommand(); command16.AdminFlags = "CanSaveAll"; ChatCommand.AddCommand("/saveall", command16); MasterAdminCommand command17 = new MasterAdminCommand(); command17.AdminFlags = "RCON"; ChatCommand.AddCommand("/setmasteradmin", command17); ChatCommand.AddCommand("/share", new ShareCommand()); ChatCommand.AddCommand("/starter", new StarterCommand()); TeleportHereCommand command18 = new TeleportHereCommand(); command18.AdminFlags = "CanTeleport"; ChatCommand.AddCommand("/tphere", command18); TeleportToCommand command19 = new TeleportToCommand(); command19.AdminFlags = "CanTeleport"; ChatCommand.AddCommand("/tpto", command19); UnbanCommand command20 = new UnbanCommand(); command20.AdminFlags = "CanUnban"; ChatCommand.AddCommand("/unban", command20); ChatCommand.AddCommand("/unfriend", new UnfriendCommand()); RemoveFlagsCommand command21 = new RemoveFlagsCommand(); command21.AdminFlags = "CanUnflag"; ChatCommand.AddCommand("/unflag", command21); UnmuteCommand command22 = new UnmuteCommand(); command22.AdminFlags = "CanUnmute"; ChatCommand.AddCommand("/unmute", command22); ChatCommand.AddCommand("/unshare", new UnshareCommand()); WhiteListAddCommand command23 = new WhiteListAddCommand(); command23.AdminFlags = "CanWhiteList"; ChatCommand.AddCommand("/addwl", command23); }
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); } }