02.01.2011, 08:14
(
Последний раз редактировалось Ironboy; 02.01.2011 в 08:54.
)
pawn Код:
CMD:count(playerid,params[]) {
new ccseconds;
if (sscanf(params, "i", ccseconds)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /count [seconds]");
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this command");
return 1;
}
if (isnull(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
if (!IsNumeric(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
if (ccseconds < 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
if (ccseconds > 20) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
if (cseconds) return SendClientMessage(playerid, COLOR_BRIGHTRED, "A countdown is already running.");
CountingTimer = SetTimer("ctimer", 1000, true);
format(cstring,40,"You started a countdown of %d seconds.",ccseconds);
SendClientMessage(playerid,COLOR_LIGHTBLUE, cstring);
cseconds = ccseconds+1;
cCount[playerid] = 1;
return 1;
}