07.04.2012, 23:49
Oh my, I see what I did wrong.
I had to put all the code after the else statement.
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;
}