auto restart script -
rekatluos - 07.08.2011
Hello guys,i hope this aint the wrong section to ask for this . I need a script that will restart the server at ...lets say... 00:00 (hour) every day . It can be a filterscript (if it doesnt interfere with my gamemode) or just a code to add to my gamemode .
thx in advance,i hope someone can help me with that
p.s : if its possible to make it auto-execute a server command i made ( i made a /restart command that restarts and gives players messages so they know the server is restarting ) . also if there can be a way to make a "pre-restart"message . like ,before the restart with 30 mins : " This server will restart in 30 minutes. "
Re: auto restart script -
Kingunit - 07.08.2011
Do you know how to create timers?
Re: auto restart script -
THE_KNOWN - 07.08.2011
@kingunit i bet he knows but the prob is.. he wants it synced with irl time 00:00 and a message abt restart b4 30 mins... the prob is linux doesnt return the exact time
Re: auto restart script -
rekatluos - 07.08.2011
yep,i want a rl time like the payday (i think that uses real time )....timers would be messed up cause they would start the count when the server starts ,i want EXACTLY at the hour 00:00
Re: auto restart script -
grand.Theft.Otto - 07.08.2011
Look for some roleplay gamemodes and find some clocks.
Re: auto restart script -
Kingunit - 07.08.2011
What is the 'real time'. There are alot of timezones ... Wich one you wanted to use?
Re: auto restart script -
rekatluos - 07.08.2011
GMT +3 (i think) Romania Bucharest
i already have something to display realtime hour /date
pawn Код:
public settime(){
new hour,minute,second;
new string[256];
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
else {format(string,25,"%d:%d",hour,minute);}
TextDrawSetString(Ora,string);
//
if (minute <= 9){format(string,25,":%d",second);}
else {format(string,25,":%d",second);}
TextDrawSetString(Secunde,string);
//
SetWorldTime(hour);
new day, month, year;
new weekday;
getdate(day, month, year);
weekday = GetWeekdayNum(day, month, year);
if(weekday == 1){TextDrawSetString(Zile,"Vineri");}
if(weekday == 2){TextDrawSetString(Zile,"Sambata");}
if(weekday == 3){TextDrawSetString(Zile,"Duminica");}
if(weekday == 4){TextDrawSetString(Zile,"Luni");}
if(weekday == 5){TextDrawSetString(Zile,"Marti");}
if(weekday == 6){TextDrawSetString(Zile,"Miercuri");}
if(weekday == 7){TextDrawSetString(Zile,"Joi");}
return 1;
}
ORA means hour ,Zile means days
Re: auto restart script -
linuxthefish - 07.08.2011
Have a timer to check the server time every hour. If the hour == 23, then restart the server.
Re: auto restart script -
Kingunit - 07.08.2011
Just a question, are you hosting at Volt-host? Then you can use their function:
Re: auto restart script -
rekatluos - 07.08.2011
if i knew how to make that i wouldnt ask for one ,never actually used anything that has something to do with time xD.
edit : no,its hosted by forceds.ro