Possible to add a string in SetTimer?
#8

Well i am having a issue with the command, when i type /restart with no time it does the "/restart <minutes>" like its supposed to but when i put in a time its a unknown command.

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>");
        }
        if(gmxdelay == 0)
        {
            return SendClientMessage(playerid, Color_Blue,"It must be at least one minute.");
        }
        else
        {        
            SetTimer("Timer_Restart_Kick",gmxdelay*1000*60,false);
            new string[128];
            format(string,sizeof(string),"The server will restart in %d minute.",gmxdelay);
            SendClientMessageToAll( Color_Blue,string);
        }
        return 1;
    }
Thats what i have. same as what you have except i changed the timer and the command.
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)