Server restart with countdown timer
#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


Messages In This Thread
Server restart with countdown timer - by gurmani11 - 17.06.2013, 16:41
Re: Server restart with countdown timer - by Jeffry - 17.06.2013, 16:50
Re: Server restart with countdown timer - by gurmani11 - 17.06.2013, 17:35
Re: Server restart with countdown timer - by Jeffry - 17.06.2013, 18:03
Re: Server restart with countdown timer - by gurmani11 - 19.06.2013, 16:53

Forum Jump:


Users browsing this thread: 2 Guest(s)