GMX Set Time Help
#1

Код:
command(gmx, playerid, params[])
{
    new reason[128];
    if(sscanf(params, "z", reason)) {
        if(Player[playerid][AdminLevel] >= 6) {
            SendClientMessage(playerid, WHITE, "Server:  /gmx [reason]");
        }
    }
    else {
        if(Player[playerid][AdminLevel] >= 6) {
            if(CurGMX == 0) {
                GMXPrep(playerid, reason);
            }
            else {
                SendClientMessage(playerid, WHITE, "There already is a current GMX in execution.");
            }
        }
    }
    return 1;
}
I am wondering how I can add or change the timer for this so it can be set between two set times.

Ex: /gmx [time] [reason]
Ex: /gmx 10(in minutes) Updates

Would anyone know how I could go about doing this?
Reply
#2

pawn Код:
CMD:gmx(playerid,params[])
    {
                    new str[128],seconds;
                    if(Player[playerid][AdminLevel] < 6) return 0;//this will show unknown command for under lvl 6
            if(sscanf(params,"ds[50]",seconds,reason)) return SCM(playerid,grey,"USAGE: /gmx [seconds] [reason]");
            format(str,sizeof(str),"Server is going to restart in %d seconds. Reason: %s",seconds,reason);
            SendClientMessageToAll(-1,str);
            SetTimer("Restart",seconds*1000,0);
        return 1;
    }
forward Restart();
public Restart()
{
    SendRconCommand("gmx");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)