[Tutorial] How to make Random weather.
#1

Hello SA-MP members. I had this in my GM for a long time, so i thought i should not be the only one to know how to do it.
So i decided to share it with you all. I think it would be great for RP servers like mine.

Here goes, we need to make a new variable.

pawn Код:
new Weather;
Then we need to make a function and forward it.

pawn Код:
forward RandomWeather();
public RandomWeather()
{

}
That by itself will do nothing so here is where the advance part comes in.
We need a Timer to set when to change the weather. Put the timer under, "OnGamModeInit();"

pawn Код:
SetTimer("RandomWeather",60000,true);//This sets the timer that will be repeated for 1 minute (1000 ms = 1 second) hence 1000 x 60 = 60000 (1 minute)
Now we will soon be finished but we need to add the rest of what the function will do.

pawn Код:
public RandomWeather()
{
    Weather = random(20);//The variable that we created will hold the random weather.
    SetWeather(Weather);//This will set the weather to a random number which is held in the variable "Weather"
}
I suggest you look here: Click Me, for the ids of the weather so you can know what you want.

We are finished. Thanks for reading and Learning.
Reply


Messages In This Thread
How to make Random weather. - by Tee - 05.02.2011, 15:23
Re: How to make Random weather. - by Ockad - 05.02.2011, 18:29
Re: How to make Random weather. - by [03]Garsino - 05.02.2011, 18:31
Re: How to make Random weather. - by Antonio [G-RP] - 05.02.2011, 18:32
Re: How to make Random weather. - by Ockad - 05.02.2011, 18:34
Re: How to make Random weather. - by [03]Garsino - 05.02.2011, 18:36
Re: How to make Random weather. - by Ockad - 05.02.2011, 18:37
Re: How to make Random weather. - by Tee - 05.02.2011, 18:48
Re: How to make Random weather. - by HeLiOn_PrImE - 19.06.2012, 10:08
Re: How to make Random weather. - by Jonny5 - 21.06.2012, 23:52

Forum Jump:


Users browsing this thread: 1 Guest(s)