SA-MP Forums Archive
Server restart with countdown timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server restart with countdown timer (/showthread.php?tid=444637)



Server restart with countdown timer - gurmani11 - 17.06.2013

.....................


Re: Server restart with countdown timer - Jeffry - 17.06.2013

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.


Re: Server restart with countdown timer - gurmani11 - 17.06.2013

IT WORKS ty ty <3


Re: Server restart with countdown timer - Jeffry - 17.06.2013

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


Re: Server restart with countdown timer - gurmani11 - 19.06.2013

.....................