Weather System
#1

How to make a weather system which tells us the viibility wind speed sunny,cloudy,etc.
Reply
#2

Well, you can get the weather, I think it's GetWeather(); and make it return a message based off of the weather ID.
Reply
#3

Can you give me an example
Reply
#4

Something like this. You also need to store the weather ID in a variable.

Has not been tested.

pawn Код:
// Top of your script:
new weather;

// Under any callback (you need to store the weather in a variable so we can call it later):
weather = 1;
SetWeather(1);

// Stock (I got the descriptions from wiki.sa-mp.com/wiki/WeatherID)
stock GetWeather()
{
    if(weather == 0)
    {
        SendClientMessageToAll(playerid, -1, "The weather is extra sunny!");
    }

    else if(weather == 1)
    {
        SendClientMessageToAll(playerid, -1, "The weather is sunny!!");
    }

    else if(weather == 2)
    {
        SendClientMessageToAll(playerid, -1, "The weather is extra sunny and smog!");
    }

    // etc etc

    return 1;
}
Reply
#5

noob question. if you cant do this youself, you should learn programming first
Reply
#6

Quote:
Originally Posted by Baltazar
Посмотреть сообщение
noob question. if you cant do this youself, you should learn programming first
Isn't that what he's trying to do? No need to be a dick.
Reply
#7

I was looking for something like this a while ago. The only way i could think of it working is to make my own weather system. EG: SetPlayerWeather(playerid, weather); under OnPlayerEnterDynamicArea.

So something like:

pawn Код:
#include streamer

new PlayerWeather[MAX_PLAYERS];

public OnPlayerEnterDynamicArea(playerid,areaid)
{
    if(areaid == AREA_BONE_COUNTY)
    {
        PlayerWeather[playerid] = 1;
    }
    if(areaid == AREA_LAS_VENTURAS)
    {
        PlayerWeather[playerid] = 2;
    }
    SetPlayerWeather(playerid,PlayerWeather[playerid]);
}

stock GetWeather(playerid)
{
    new weatherstr[15];
    switch(PlayerWeather[playerid])
    {
        case 1: weatherstr = "Sandstorm";
        case 2: weatherstr = "Heatwave";
    }
    return weatherstr;
}
This is untested, but thats the general idea of it(at least i think so). I'll be making a weather streamer soon anyway. Or you can search for Mick88 and check his releases. He's released a streamer for weather previously. I know how to get it working also.
Reply
#8

No i meant in a textdraw box which comes in middle and disappear after 5 sec or so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)