28.03.2010, 12:27
pawn Код:
new Counting;
pawn Код:
if (strcmp(cmd, "/cd", true) == 0)
{
if(Counting == 1) return SendClientMessage(playerid,COLOR_WHITE,"Can't do that!");
if(PlayerInfo[playerid][pAdmin] < 3) return DenyMessage(playerid, 3);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"/countdown [seconds] [freeze 1/0]");
cd_sec = strval(tmp);
if(cd_sec < 0||cd_sec >1000) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Seconds between 0-1000");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"/countdown [seconds] [freeze 1/0]");
cd_f = strval(tmp);
if(cd_f < 0 || cd_f > 1) return SendClientMessage(playerid,COLOR_WHITE,"/countdown [seconds] [freeze 1/0]");
if(cd_f == 1)
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
TogglePlayerControllable(i, 0);
}
cd_timer = SetTimer("countdown",1000,3);
Counting = 1;
return 1;
}