How can i make a auto-time changer?
#1

Hi, i am running a samp server.....but it is always the same time in my server XD,
so, can anyone help me making a script with a timer or something to auto-change the time in my server? and i know, i am a noob in scripting
i only know the basic things......

so thanx if anyody can help me!
Reply
#2

Under includes:
Код:
new weatherids[21] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
forward OnServerChangeWeather();
Under OnGameModeInIt:
Код:
SetTimer("OnServerChangeWeather", 300000, true);
Anywhere in your script since it is not in another callback:
Код:
public OnServerChangeWeather()
{
	new azhour, azminute, azsecond;
	gettime(azhour, azminute, azsecond);
	SetWorldTime(azhour);
    new weatherid = weatherids[random(21)];
    SetWeather(weatherid);
	return 1;
}
This will also sync the time in real world and game.
Reply
#3

Quote:
Originally Posted by ronyx69
Under includes:
Код:
new weatherids[21] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
forward OnServerChangeWeather();
Under OnGameModeInIt:
Код:
SetTimer("OnServerChangeWeather", 300000, true);
Anywhere in your script since it is not in another callback:
Код:
public OnServerChangeWeather()
{
	new azhour, azminute, azsecond;
	gettime(azhour, azminute, azsecond);
	SetWorldTime(azhour);
    new weatherid = weatherids[random(21)];
    SetWeather(weatherid);
	return 1;
}
This will also sync the time in real world and game.
THANXXXXXXXXXXXXX!!!!!!!!!!!!!!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)