Possible to add a string in SetTimer?
#10

Oh my, I see what I did wrong.
I had to put all the code after the else statement.
pawn Код:
if(!strcmp(cmdtext,"/restart",true))
    {
        if(!IsPlayerAdmin(playerid))
        {
            return SendClientMessage(playerid, Color_Red,"Only admins can use this command.");
        }
        new gmxdelay;
        if(sscanf(cmdtext,"d",gmxdelay))
        {
            return SendClientMessage(playerid, Color_Red,"Syntax: /restart <minutes>");
        }
        else
        {
            if(gmxdelay == 0)
            {
                return SendClientMessage(playerid, Color_Blue,"It must be at least one minute.");
            }
            SetTimer("Timer_Restart_Kick",gmxdelay*1000*60,false);
            new string[128];
            format(string,sizeof(string),"The server will restart in %d minutes.",gmxdelay);
            SendClientMessageToAll( Color_Blue,string);
        }
        return 1;
    }
Reply


Messages In This Thread
Possible to add a string in SetTimer? - by nickdodd25 - 29.03.2012, 03:28
Re: Possible to add a string in SetTimer? - by AustinJ - 29.03.2012, 03:40
Re: Possible to add a string in SetTimer? - by nickdodd25 - 04.04.2012, 03:17
Re: Possible to add a string in SetTimer? - by ViniBorn - 04.04.2012, 03:32
Re: Possible to add a string in SetTimer? - by ReneG - 04.04.2012, 03:35
Re: Possible to add a string in SetTimer? - by nickdodd25 - 04.04.2012, 03:58
Re: Possible to add a string in SetTimer? - by ReneG - 04.04.2012, 04:26
Re: Possible to add a string in SetTimer? - by nickdodd25 - 07.04.2012, 23:09
Re: Possible to add a string in SetTimer? - by Jonny5 - 07.04.2012, 23:46
Re: Possible to add a string in SetTimer? - by ReneG - 07.04.2012, 23:49
Re: Possible to add a string in SetTimer? - by [DOG]irinel1996 - 08.04.2012, 00:14
Re: Possible to add a string in SetTimer? - by Y_Less - 08.04.2012, 00:23

Forum Jump:


Users browsing this thread: 1 Guest(s)