24.03.2014, 15:50
(
Последний раз редактировалось Jefff; 24.03.2014 в 20:52.
)
pawn Код:
public DTime(times)
{
if(times > 0)
{
new string[10];
format(string, sizeof(string), "~g~%d", times);
GameTextForAll(string, 1300, 6);
SetTimerEx("DTime",1000,false,"i",times-1);
}else
GameTextForAll("~r~GO!!!", 1000, 6);
return 1;
}
dcmd_countdown(playerid, params[])
{
if(isnull(params)) return SendClientMessage( playerid, -1, "{FF0099}[ADMIN]{FFFFFF}/countdown [time]" );
if(!(0 < strval(params) < 21)) return SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF}You can start a countdown from 20 only!");
DTime(strval(params));
// SetTimerEx("DTime",1000,false,"i",strval(params));
new pName[24],string[128];
GetPlayerName(playerid,pName,24);
format(string,sizeof(string),"{FF0099}[ADMIN]{FFFFFF}%s has initiated a countdown starting from %d",pName,strval(params));
return SendClientMessageToAll(COLOR_ADMIN,string);
}