Пример #1
0
        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);
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
        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}.");
            }
        }
Пример #4
0
        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);
        }