05.02.2011, 15:23
(
Последний раз редактировалось Tee; 05.02.2011 в 18:47.
)
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.
Then we need to make a function and forward it.
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();"
Now we will soon be finished but we need to add the rest of what the function will do.
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.
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;
pawn Код:
forward RandomWeather();
public RandomWeather()
{
}
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)
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"
}
We are finished. Thanks for reading and Learning.