if (strcmp(cmd, "/cd", true) == 0) { 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); return 1; }
new Counting;
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;
}
Originally Posted by MadeMan
pawn Код:
pawn Код:
|
public countdown(playerid) , this counting = 0;