SA-MP Forums Archive
Weather System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weather System (/showthread.php?tid=506887)



Weather System - KDark - 15.04.2014

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


Re: Weather System - Mattakil - 15.04.2014

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


Re: Weather System - KDark - 16.04.2014

Can you give me an example


Re: Weather System - Dignity - 16.04.2014

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;
}



Re: Weather System - Baltazar - 16.04.2014

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


Re: Weather System - Dignity - 16.04.2014

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.


Re: Weather System - DobbysGamertag - 16.04.2014

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.


Re: Weather System - KDark - 16.04.2014

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