Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new SWeather = 0;
- #define WEATHER_UNKNOWN 0
- #define WEATHER_SUNNY 1
- #define WEATHER_MOSTLY_SUNNY 2
- #define WEATHER_PARTLY_CLOUDY 3
- #define WEATHER_MOSTLY_CLOUDY 4
- #define WEATHER_CLOUDY 5
- #define WEATHER_LIGHT_RAIN 6
- #define WEATHER_SHOWERS 7
- #define WEATHER_RAIN 8
- #define WEATHER_LIGHT_THUNDERSTORM 9
- #define WEATHER_THUNDERSTORM 10
- #define WEATHER_MIST 11
- #define WEATHER_SNOWRAIN 12
- #define WEATHER_LIGHT_SNOW 13
- task SvrWeather[600000]()
- {
- HTTP(0,HTTP_GET,"sa-mp.vn/test.php","","GetRealWeather");
- return 1;
- }
- forward GetRealWeather(index,response_code, data[]);
- public GetRealWeather(index,response_code, data[])
- {
- if(response_code == 200)
- {
- if(!strcmp(data, "Sunny")) SWeather = WEATHER_SUNNY;
- else if(!strcmp(data, "Fair") || !strcmp(data, "Mostly Sunny")) SWeather = WEATHER_MOSTLY_SUNNY;
- else if(!strcmp(data, "Partly Cloudy")) SWeather = WEATHER_PARTLY_CLOUDY;
- else if(!strcmp(data, "Mostly Cloudy")) SWeather = WEATHER_MOSTLY_CLOUDY;
- else if(!strcmp(data, "Cloudy")) SWeather = WEATHER_CLOUDY;
- else if(!strcmp(data, "Light Rain")) SWeather = WEATHER_LIGHT_RAIN;
- else if(!strcmp(data, "Showers") || !strcmp(data, "Scattered Showers")) SWeather = WEATHER_SHOWERS;
- else if(!strcmp(data, "Rain")) SWeather = WEATHER_RAIN;
- else if(!strcmp(data, "Mist") || !strcmp(data, "Fog") || !strcmp(data, "Haze")) SWeather = WEATHER_MIST;
- else if(!strcmp(data, "Rain/Snow") || !strcmp(data, "Rain/Snow Showers")) SWeather = WEATHER_SNOWRAIN;
- else if(!strcmp(data, "Light Snow")) SWeather = WEATHER_LIGHT_SNOW;
- else if(!strcmp(data, "T-Rain") || !strcmp(data, "Scattered T-Storm")) SWeather = WEATHER_LIGHT_THUNDERSTORM;
- else if(!strcmp(data, "T-Storm") || !strcmp(data, "Isolated T-Storm")) SWeather = WEATHER_THUNDERSTORM;
- printf(" Get weather success Weather ID : %d - %s", SWeather, data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment