Advertisement
BrinqueDo

Sistema de Mudança Climática

Oct 15th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.38 KB | None | 0 0
  1. /* Sistema de mudança climatica com anuncio do reporter
  2.  
  3.     Créditos: BrinqueDo
  4.  
  5. */
  6.  
  7. #include <a_samp>
  8. #include <zcmd>
  9.  
  10. #define CORCLIMA   0xFFFFAFAA
  11. #define CLIMA1 "[Previsão do Tempo] Dia Limpo, Mínima de {0342F8}22°C{FFFFAF}, Máxima de {F80303}26°C{FFFFAF}."
  12. #define CLIMA2 "[Previsão do Tempo] Clima Seco, Mínima de {0342F8}24°C{FFFFAF}, Máxima de {F80303}28°C{FFFFAF}."
  13. #define CLIMA3 "[Previsão do Tempo] Ventos Fortes, Mínima de {0342F8}19°C{FFFFAF}, Máxima de {F80303}22°C{FFFFAF}."
  14. #define CLIMA4 "[Previsão do Tempo] Tempo Nublado com Ventos fortes, Mínima de {0342F8}15°C{FFFFAF}, Máxima de {F80303}18°C{FFFFAF}."
  15. #define CLIMA5 "[Previsão do Tempo] Tempo Chuvoso com Ventos fortes, Mínima de {0342F8}12°C{FFFFAF}, Máxima de {F80303}15°C{FFFFAF}."
  16. #define CLIMA6 "[Previsão do Tempo] Neblina forte, Mínima de {0342F8}2°C{FFFFAF}, Máxima de {F80303}5°C{FFFFAF}."
  17. #define CLIMA7 "[Previsão do Tempo] Céu Limpo, Mínima de {0342F8}22°C{FFFFAF}, Máxima de {F80303}26°C{FFFFAF}."
  18. #define CLIMA8 "[Previsão do Tempo] Nublado com Ventos fracos, Mínima de {0342F8}15°C{FFFFAF}, Máxima de {F80303}18°C{FFFFAF}."
  19. #define CLIMA9 "[Previsão do Tempo] Céu amarelado, Mínima de {0342F8}19°C{FFFFAF}, Máxima de {F80303}21°C{FFFFAF}."
  20. #define CLIMA10 "[Previsão do Tempo] Tempo Nublado, Mínima de {0342F8}12°C{FFFFAF}, Máxima de {F80303}15°C{FFFFAF}."
  21. #define CLIMA11 "[Previsão do Tempo] Chuva Forte, Cuidado com a pista escorregadia, Mínima de {0342F8}4°C{FFFFAF}, Máxima de {F80303}7°C{FFFFAF}."
  22. #define CLIMA12 "[Previsão do Tempo] Céu Alaranjado, Mínima de {0342F8}11°C{FFFFAF}, Máxima de {F80303}14°C{FFFFAF}."
  23. #define CLIMA13 "[Previsão do Tempo] Neblina Densa com Vento forte, Mínima de {0342F8}-2°C{FFFFAF}, Máxima de {F80303}1°C{FFFFAF}."
  24.  
  25. new TimerPrevisao;
  26.  
  27. main(){}
  28.  
  29. public OnGameModeInit()
  30. {
  31.     return 1;
  32. }
  33.  
  34.  
  35. public OnPlayerRequestClass(playerid, classid)
  36. {
  37.     return 1;
  38. }
  39.  
  40.  
  41. forward Previsao();
  42. public Previsao()
  43. {
  44.      new clima = random(12);
  45.      if(clima == 0) { SetWeather(0);SendClientMessageToAll (CORCLIMA, CLIMA1);}
  46.      if(clima == 1) { SetWeather(1);SendClientMessageToAll (CORCLIMA, CLIMA2);}
  47.      if(clima == 2) { SetWeather(3);SendClientMessageToAll (CORCLIMA, CLIMA3);}
  48.      if(clima == 3) { SetWeather(7);SendClientMessageToAll (CORCLIMA, CLIMA4);}
  49.      if(clima == 4) { SetWeather(8);SendClientMessageToAll (CORCLIMA, CLIMA5);}
  50.      if(clima == 5) { SetWeather(9);SendClientMessageToAll (CORCLIMA, CLIMA6);}
  51.      if(clima == 6) { SetWeather(11);SendClientMessageToAll (CORCLIMA, CLIMA7);}
  52.      if(clima == 7) { SetWeather(12);SendClientMessageToAll (CORCLIMA, CLIMA8);}
  53.      if(clima == 8) { SetWeather(13);SendClientMessageToAll (CORCLIMA, CLIMA9);}
  54.      if(clima == 9) { SetWeather(15);SendClientMessageToAll (CORCLIMA, CLIMA10);}
  55.      if(clima == 10) { SetWeather(16);SendClientMessageToAll (CORCLIMA, CLIMA11);}
  56.      if(clima == 11) { SetWeather(17);SendClientMessageToAll (CORCLIMA, CLIMA12);}
  57.      if(clima == 12) { SetWeather(19);SendClientMessageToAll (CORCLIMA, CLIMA13);}
  58. }
  59.  
  60. CMD:ativarprevisao(playerid)
  61. {
  62.     SendClientMessage(playerid, -1, "Você ativou a mudança climatica.");
  63.     TimerPrevisao = SetTimer("Previsao", 10000, true);
  64.     return 1;
  65. }
  66.  
  67. CMD:desativarprevisao(playerid)
  68. {
  69.     SendClientMessage(playerid, -1, "Você desativou a mudança climatica.");
  70.     KillTimer(TimerPrevisao);
  71.     return 1;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement