Advertisement
De4dpOol

Automatic random weather with weather news by De4dpOol.

Feb 17th, 2015
1,451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. /*==============================================================================
  2. ----------------------Automatic weather changer By Deadpool---------------------
  3. ==============================================================================*/
  4.  
  5. //Includes
  6. #include <a_samp>
  7.  
  8. //defines
  9. #define WEATHER_TIME 3 // 3 hrs
  10.  
  11. //new(s)
  12. new CurrentWeather;
  13.  
  14. //Forward(s)
  15. forward ChangeWeather();
  16.  
  17. //Stock(s)
  18. stock GetWeatherName(weatherid)
  19. {
  20. new WeatherNameString[100];
  21.  
  22. switch(weatherid)
  23. {
  24. case 0: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  25. case 1: format(WeatherNameString, sizeof(WeatherNameString), "Sunny with high visibility and moderate clouds");
  26. case 2: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  27. case 3: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  28. case 4: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  29. case 5: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  30. case 6: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  31. case 7: format(WeatherNameString, sizeof(WeatherNameString), "Extra Sunny with high visibility and moderate clouds");
  32. case 8: format(WeatherNameString, sizeof(WeatherNameString), "Wet and Rainy with medium visibility and heavy clouds");
  33. case 9: format(WeatherNameString, sizeof(WeatherNameString), "Thick Foggy with low visibility and heavy clouds");
  34. case 10: format(WeatherNameString, sizeof(WeatherNameString), "Sunny with high visibility and moderate clouds");
  35. case 11: format(WeatherNameString, sizeof(WeatherNameString), "HeatWave with high visibility and moderate clouds");
  36. case 12: format(WeatherNameString, sizeof(WeatherNameString), "Hazy/Dull with moderate visibility and high clouds");
  37. case 13: format(WeatherNameString, sizeof(WeatherNameString), "Hazy/Dull with moderate visibility and high clouds");
  38. case 14: format(WeatherNameString, sizeof(WeatherNameString), "Hazy/Dull with moderate visibility and high clouds");
  39. case 15: format(WeatherNameString, sizeof(WeatherNameString), "Heavy RainStorm with low visibility and very thick clouds");
  40. case 16: format(WeatherNameString, sizeof(WeatherNameString), "Wet and Rainy with medium visibility and heavy clouds");
  41. case 17: format(WeatherNameString, sizeof(WeatherNameString), "Scorching Hot Bright with high visibility and low clouds");
  42. case 18: format(WeatherNameString, sizeof(WeatherNameString), "Scorching Hot Bright with high visibility and low clouds");
  43. case 19: format(WeatherNameString, sizeof(WeatherNameString), "Sand Storm with very low visibility and high clouds");
  44. case 20: format(WeatherNameString, sizeof(WeatherNameString), "Toxic Green Smog with low visibility and high clouds");
  45. }
  46. return WeatherNameString;
  47. }
  48.  
  49. //Public(s)
  50. public OnFilterScriptInit()
  51. {
  52. print("\n---------------------------------------------");
  53. print(" Automatic Weather Changer By De4dpOol loaded!!");
  54. print("---------------------------------------------\n");
  55.  
  56. SetTimer("ChangeWeather", WEATHER_TIME * 3600 * 1000, 1);
  57.  
  58. return 1;
  59. }
  60.  
  61. public OnPlayerSpawn(playerid)
  62. {
  63. SetPlayerWeather(playerid, CurrentWeather);
  64. return 1;
  65. }
  66.  
  67. public ChangeWeather()
  68. {
  69. new NewWeather, NEWS[120];
  70. NewWeather = random(20);
  71.  
  72. SetWeather(NewWeather);
  73. CurrentWeather = NewWeather;
  74.  
  75. format(NEWS, sizeof(NEWS), "[[WEATHER REPORT]] Today's weather will be %s.", GetWeatherName(NewWeather));
  76. SendClientMessageToAll(-1, NEWS);
  77. }
  78.  
  79. /*==============================================================================
  80. ---------------------------------End of Script----------------------------------
  81. ==============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement