Advertisement
Nominal

n_Weather

Sep 2nd, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. new serverweather = 0; //default server weather
  2. #include <mapandreas>//comment this line if you dont want to use mapandreas
  3. #include <zcmd>//comment this line if you dont want to use whatsweather command
  4. #define MapAndreasUser//Comment this define to disable MapAndreas use (warning: disabling mapandreas using you will disable IsPlayerOnRain function)
  5. #define ZCMDUser //Comment this define to disable ZCMD use (warning: disabling mapandreas using you will disable whatsweather command)
  6.  
  7. #if defined MapAndreasUser
  8. stock IsPlayerOnRain(playerid)
  9. {
  10. if(serverweather == 8 || serverweather == 16)
  11. {
  12. new Float:x, Float:y, Float:z, Float:new_z;
  13. GetPlayerPos(playerid, x, y, z);
  14.  
  15. MapAndreas_FindZ_For2DCoord(x, y, new_z);
  16.  
  17. if(new_z > z)
  18. {
  19. return 0;
  20. }
  21. else return 1;
  22. }
  23. else return 0;
  24. }
  25. #endif
  26.  
  27. forward HookSetWeather(weatherid);
  28. public HookSetWeather(weatherid)
  29. {
  30. serverweather = weatherid;
  31. return SetWeather(weatherid);
  32. }
  33. #define SetWeather HookSetWeather
  34.  
  35. GetWeather()
  36. {
  37. return serverweather;
  38. }
  39.  
  40. #if defined ZCMDUser
  41. CMD:whatsweather(playerid)
  42. {
  43. new string[64];
  44. format(string, sizeof(string), "Weather atual: %d", GetWeather());
  45. SendClientMessage(playerid, -1, string);
  46. return 1;
  47. }
  48. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement