SA-MP Forums Archive
Weather - 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 (/showthread.php?tid=330601)



Weather - AstonDA-G - 01.04.2012

Hi all.

Ok, So underneath OnGameModeInit i have this:
Код:
SetWeather(08);
and it works when i first spawn, but about five seconds later, the weather goes back to the default clear weather.
Anyone know what i'm doing wrong?
Thanks
-Aston


Re: Weather - TzAkS. - 01.04.2012

Search for SetWeather and delete if u have other one


Re: Weather - Tanush123 - 02.04.2012

Try it under onplayerconnect


Re: Weather - MP2 - 02.04.2012

Search for instances of SetPlayerWeather and SetWeather in your scripts. Also, shouldn't it be '8' not 08?


Re: Weather - [ABK]Antonio - 02.04.2012

Default is being overwritten therefore it's something else setting it in your script. Check your timers


Re: Weather - Reklez - 02.04.2012

Something like a Time System blocking your Weather Code.

EDIT:
Do you have a Time System or any Weather System Timer code set on your script?


Re: Weather - AstonDA-G - 02.04.2012

I have no other systems in my script whatsoever, time, weather, there's nothing.


Re: Weather - Tanush123 - 02.04.2012

Try using setplayerweather when player connects


Re: Weather - JJB562 - 02.04.2012

Try using this:

Under OnGameModeInIt
pawn Код:
SetTimer("Weather", 5000, true);
This will create a timer, so the weather you want will be set every 5 seconds.

Anywhere In Your Script:
pawn Код:
forward Weather();
public Weather()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerWeather(i, 8);
    }
    return 1;
}
This will make it so every player will get the same weather, every time the timer is called.


Re: Weather - Tanush123 - 03.04.2012

Quote:
Originally Posted by JJB562
Посмотреть сообщение
Try using this:

Under OnGameModeInIt
pawn Код:
SetTimer("Weather", 5000, true);
This will create a timer, so the weather you want will be set every 5 seconds.

Anywhere In Your Script:
pawn Код:
forward Weather();
public Weather()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerWeather(i, 8);
    }
    return 1;
}
This will make it so every player will get the same weather, every time the timer is called.
Why do you have to loop? Just do SetWeather and it's fine