07.04.2012, 23:09
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.
Thats what i have. same as what you have except i changed the timer and the 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;
}