Random 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: Random weather (
/showthread.php?tid=317578)
Random weather -
jcvag44800 - 11.02.2012
Hi guys,
I want to make a filterscript for a random weather
This is my script:
Код:
#include <a_samp>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Lancement FS mйteo");
print("--------------------------------------\n");
print("Lancement timer mйteo");
SetTimerEx("message", 1000, false, "is", 1337, "hello!");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
forward message(second, msg[]);
public message(second, msg[])
{
SetTimerEx("message", 4000, false, "is", 1337, "hello!");
// SetTimerEx("message", 3610000, false, "is", 1337, "hello!"); Final
return 1;
}
But I do not know how to do it
I would have thought something like this:
Код:
new weather[][4] =
{
// Positions, (X, Y, Z and Facing Angle)
SetWeather(19),
....
};
But, my pawno crash
Cordially.
AW: Random weather -
Drebin - 11.02.2012
Do you mean random weather which sets for every player after a certain time?
Make a timer and inside this timer make an array with weather IDs. Whenever the function is called by the timer, you get a random weather ID from the array (
random(sizeof(WeatherArray))) and set it for all players.
Re: Random weather -
[MG]Dimi - 11.02.2012
pawn Код:
#include <a_samp>
#define WEATHER_MINUTES 3
forward Weather();
new WeatherTimer;
public OnGameModeInit()
{
WeatherTimer = SetTimer("Weather",WEATHER_MINUTES*60*1000,1);
return 1;
}
public OnGameModeExit()
{
KillTimer(WeatherTimer);
return 1;
}
public Weather()
{
return SetWeather(random(22)+1);
}
I counted that there are Weather IDs from 1-22. You edit it as you want.