29.06.2018, 00:19
Hello guys, I have one problem. I am working on one mode so I made a classic "clock".
But I want that when the time is 00 and minutes 00 my server restar on just few seconds.
I tried with this but it doesn't work.
But I want that when the time is 00 and minutes 00 my server restar on just few seconds.
I tried with this but it doesn't work.
Код:
public OnPlayerUpdate( playerid )
{
gettime( gametime,minutes);
SetPlayerTime( playerid, gametime, minutes);
if(gametime == 00 && minutes == 00 && gameday == 1 || gametime == 00 && minutes == 00 && gameday == 2 || gametime == 00 && minutes == 00 && gameday == 3 || gametime == 00 && minutes == 00 && gameday == 4 || gametime == 00 && minutes == 00 && gameday == 5 || gametime == 00 && minutes == 00 && gameday == 6 || gametime == 00 && minutes == 00 && gameday == 7)
{
SendRconCommand("gmx");
}
gametime++;
if(gametime == 0)
{
gameday ++;
}
if(gametime == 23 && minutes == 59 && gameday == 0)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Monday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 1)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Monday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 2)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Tuesday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 3)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Wednesday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 4)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Thursday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 5)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Friday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 6)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Saturday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
if(gametime == 23 && minutes == 59 && gameday == 7)
{
SendClientMessageToAll(COLOR_WHITE,"[NEXT GAME DAY] Sunday");
SendClientMessageToAll(COLOR_ADMIN,"[AUTO ADMIN] The server will restart in one minute to give it a nice fresh start and it will be closed one minute.");
}
return 1;
}


