Random weather
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)