private void OnChangeWeather([FromSource] Player source, int weather) { Debug.WriteLine($"Weather changed to {WeatherList.GetNiceName(weather)} by {source.Name}"); CurrentWeather = weather; TriggerClientEvent("virakal:setWeather", weather, source.Name); }
private void OnRequestWeather([FromSource] Player source) { Debug.WriteLine($"Weather requested by {source.Name}. Weather is {WeatherList.GetNiceName(CurrentWeather)}"); if (CurrentWeather != -1) { TriggerClientEvent(source, "virakal:setWeather", CurrentWeather); } }
private void OnSetWeather(int weather, string name) { if (weather < 0) { return; } ChangeWeather((Weather)weather); if (!string.IsNullOrWhiteSpace(name)) { Trainer.AddNotification($"~g~Weather changed to {WeatherList.GetNiceName(weather)} by {name}."); } }
private List <MenuItem> GetWeatherMenu() { var weathers = WeatherList.internalNames; var list = new List <MenuItem>(weathers.Length); for (int i = 0; i < weathers.Length; i++) { list.Add(new MenuItem() { text = WeatherList.GetNiceName(i), action = $"weather {i}", }); } return(list); }