auto restart script
#1

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

Do you know how to create timers?
Reply
#3

@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
Reply
#4

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
Reply
#5

Look for some roleplay gamemodes and find some clocks.
Reply
#6

What is the 'real time'. There are alot of timezones ... Wich one you wanted to use?
Reply
#7

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
Reply
#8

Have a timer to check the server time every hour. If the hour == 23, then restart the server.
Reply
#9

Just a question, are you hosting at Volt-host? Then you can use their function:
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)