public static void Set(ClientInfo _cInfo) { if (!GameManager.Instance.adminTools.CommandAllowedFor(_cmd, _cInfo.playerId)) { string _phrase107; if (!Phrases.Dict.TryGetValue(107, out _phrase107)) { _phrase107 = "you do not have permissions to use this command."; } ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase107 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null); } else { EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId]; Vector3 _position = _player.GetPosition(); int x = (int)_position.x; int y = (int)_position.y; int z = (int)_position.z; string _mposition = x + "," + y + "," + z; Market_Position = _mposition; string _phrase565; if (!Phrases.Dict.TryGetValue(565, out _phrase565)) { _phrase565 = "you have set the market position as {MarketPosition}."; } _phrase565 = _phrase565.Replace("{MarketPosition}", Market_Position); ChatHook.ChatMessage(_cInfo, ChatHook.Player_Name_Color + _cInfo.playerName + _phrase565 + "[-]", _cInfo.entityId, LoadConfig.Server_Response_Name, EChatType.Whisper, null); LoadConfig.UpdateXml(); } }
public override void Execute(List <string> _params, CommandSenderInfo _senderInfo) { try { if (_params.Count != 1) { SdtdConsole.Instance.Output(string.Format("Wrong number of arguments, expected 1, found {0}.", _params.Count)); return; } if (_params[0].ToLower().Equals("off")) { LobbyChat.IsEnabled = false; SdtdConsole.Instance.Output(string.Format("Lobby has been set to off")); return; } else if (_params[0].ToLower().Equals("on")) { LobbyChat.IsEnabled = true; SdtdConsole.Instance.Output(string.Format("Lobby has been set to on")); return; } else if (_params[0] == ("set")) { ClientInfo _cInfo = _senderInfo.RemoteClientInfo; EntityPlayer _player = GameManager.Instance.World.Players.dict[_cInfo.entityId]; Vector3 _position = _player.GetPosition(); int x = (int)_position.x; int y = (int)_position.y; int z = (int)_position.z; string _lposition = x + "," + y + "," + z; SetLobby.Lobby_Position = _lposition; string _phrase551; if (!Phrases.Dict.TryGetValue(551, out _phrase551)) { _phrase551 = "{PlayerName} you have set the lobby position as {LobbyPosition}."; } _phrase551 = _phrase551.Replace("{PlayerName}", _cInfo.playerName); _phrase551 = _phrase551.Replace("{LobbyPosition}", _lposition); SdtdConsole.Instance.Output(string.Format("{0}", _phrase551)); LoadConfig.UpdateXml(); } else { SdtdConsole.Instance.Output(string.Format("Invalid argument {0}.", _params[0])); } } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in CommandJailConsole.Run: {0}.", e)); } }
public override void Execute(List <string> _params, CommandSenderInfo _senderInfo) { try { if (_params.Count != 1) { SdtdConsole.Instance.Output("Wrong number of arguments."); return; } if (!int.TryParse(_params[0], out HighPingKicker.Max_Ping)) { SdtdConsole.Instance.Output("Maxping is not an integer."); return; } SdtdConsole.Instance.Output(string.Format("Max ping limit set to {0}", HighPingKicker.Max_Ping)); LoadConfig.UpdateXml(); } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in ReservedSlotConsole.Run: {0}.", e)); } }