Joksa

Hostname & Weather Changer

Mar 22nd, 2013
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.74 KB | None | 0 0
  1. //-------------------------------------------//
  2. //    Hostname & Weather Changer by Joksa    //
  3. //-------------------------------------------//
  4.  
  5.  
  6. #include <a_samp>
  7.  
  8. //Forwards
  9. forward hostname();
  10. forward ChangeWeather();
  11. //News
  12. new DefaultWeather = 10;
  13. new weather2;
  14. //Defines
  15. #define COLOR_SEA 0x00808000
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. SetTimer("hostname",5000,true);
  20. //<<< Currently it is set to change the name for 5 seconds >>>
  21. //<<< You can change the ammount of time the hostname stays till it changes(1000 = 1 second)
  22. SetTimer("ChangeWeather",1200000, true);
  23. ChangeWeather();
  24. //<<< Currently it is set to change the weather for 20 minutes >>>
  25. return 1;
  26. }
  27.  
  28. public OnPlayerCommandText(playerid, cmdtext[])
  29. {
  30.     if(strcmp("/changeweather",cmdtext, true) == 0) // By Joksa
  31.     {
  32.         if(IsPlayerAdmin(playerid))
  33.         {
  34.         ChangeWeather();
  35.         SendClientMessageToAll(0x0080FFFF,"Admin has changed the weather");
  36.         }
  37.         return 1;
  38.     }
  39.  
  40.     if(strcmp("/myweather",cmdtext, true) == 0) // By Joksa
  41.     {
  42.         SetPlayerWeather(playerid, DefaultWeather);
  43.         return 1;
  44.     }
  45.     return 0;
  46. }
  47.  
  48. public hostname()
  49. {
  50.    new HostNameChanger = random(3);
  51.    //If you want more you have to change random(3) in the example of Random(5) if you have 5 messages; if you have 8 different messages but dont forget to edit the cases too!!   switch (HostNameChanger)
  52.    switch (HostNameChanger)
  53.    {
  54.      case 0: SendRconCommand("hostname Visit My server will not regret it");
  55.      case 1: SendRconCommand("hostname Everybody is welcome!");
  56.      case 2: SendRconCommand("hostname If you come expecting rewards");
  57.      // if you edit the texts, dont remove "hostname", otherwise it wont work!!
  58.    }}
  59.  
  60. public ChangeWeather() // By Joksa
  61. {
  62.     weather2 = random(20);
  63.     DefaultWeather = weather2;
  64.     if(weather2 == 1)
  65.     {
  66.         SetWeather(1);
  67.         SendClientMessageToAll(COLOR_SEA,"[TIME]: Being of the sun, great for swimming!");
  68.     }
  69.     else if(weather2 == 2)
  70.     {
  71.         SetWeather(2);
  72.         SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
  73.     }
  74.     else if(weather2 == 3)
  75.     {
  76.         SetWeather(3);
  77.         SendClientMessageToAll(COLOR_SEA,"[TIME]: Being of the sun, great for diving!");
  78.     }
  79.     else if(weather2 == 4)
  80.     {
  81.         SetWeather(4);
  82.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
  83.     }
  84.     else if(weather2 == 5)
  85.     {
  86.         SetWeather(5);
  87.         SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
  88.     }
  89.     else if(weather2 == 6)
  90.     {
  91.         SetWeather(6);
  92.         SendClientMessageToAll(COLOR_SEA,"[TIME]: There will be a storm, best stay home!");
  93.     }
  94.     else if(weather2 == 7)
  95.     {
  96.         SetWeather(7);
  97.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
  98.     }
  99.     else if(weather2 == 8)
  100.     {
  101.         SetWeather(8);
  102.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be very rainy, stay at home!");
  103.     }
  104.     else if(weather2 == 9)
  105.     {
  106.         SetWeather(9);
  107.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be a bit cloudy, but do not worry!");
  108.     }
  109.     else if(weather2 == 10)
  110.     {
  111.         SetWeather(10);
  112.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, careful not to make it rain!");
  113.     }
  114.     else if(weather2 == 11)
  115.     {
  116.         SetWeather(11);
  117.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Good for cycling!");
  118.     }
  119.     else if(weather2 == 12)
  120.     {
  121.         SetWeather(12);
  122.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
  123.     }
  124.     else if(weather2 == 13)
  125.     {
  126.         SetWeather(13);
  127.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Great for flying!");
  128.     }
  129.     else if(weather2 == 14)
  130.     {
  131.         SetWeather(14);
  132.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny, Good for walking!");
  133.     }
  134.     else if(weather2 == 15)
  135.     {
  136.         SetWeather(15);
  137.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be cloudy and cold, you better take cover somewhere!");
  138.     }
  139.     else if(weather2 == 16)
  140.     {
  141.         SetWeather(16);
  142.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be rainy, do not forget the umbrella");
  143.     }
  144.     else if(weather2 == 17)
  145.     {
  146.         SetWeather(17);
  147.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny with a few clouds, great for walking, but bring long sleeves!");
  148.     }
  149.     else if(weather2 == 18)
  150.     {
  151.         SetWeather(18);
  152.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be sunny with a few clouds, Bring warm clothes!");
  153.     }
  154.     else if(weather2 == 19)
  155.     {
  156.         SetWeather(19);
  157.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be a dust storm, do not drive or fly!");
  158.     }
  159.     else if(weather2 == 20)
  160.     {
  161.         SetWeather(20);
  162.         SendClientMessageToAll(COLOR_SEA,"[TIME]: It will be very cloudy, be careful and take your umbrella!");
  163.     }
  164.     return 1;
  165. }
Advertisement
Add Comment
Please, Sign In to add comment