Server restart with countdown timer
#1

.....................
Reply
#2

At Top of your GM:
pawn Код:
new GMX_Count = 30;
pawn Код:
COMMAND:Gmx(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You have to be an Admin.");
    SetTimer("ServerGMX",1000,1);//2 seconds with no repeat
    new str[128];
    format(str, sizeof(str), "~r~Server is restarting - ~y~Please Wait.~n~~r~%d~b~ seconds left.",GMX_Count);
    GameTextForAll(str,30000,3);
    return 1;
}
pawn Код:
forward ServerGMX();
public ServerGMX()
{
    GMX_Count--;
    if(GMX_Count <= 0)
    {
        GameTextForAll("~r~Server is now restarting!",30000,3);
        return SendRconCommand("gmx");
    }
    new str[128];
    format(str, sizeof(str), "~r~Server is restarting - ~y~Please Wait.~n~~r~%d~b~ seconds left.",GMX_Count);
    GameTextForAll(str,30000,3);
    return 1;
}
Should work.
Reply
#3

IT WORKS ty ty <3
Reply
#4

You're welcome. Glad I could help.
Thank you for the positive reputation feedback.
Reply
#5

.....................
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)