28.01.2014, 13:32
Bom iai preciso de ajuda,esse sistema de contagem,nгo sei passar pra strcmp.
DESDE JБ AGRADEЗO !
Код:
new bool:Counting; new CD; dcmd_contar(playerid, params[]) { if(Player[playerid][pAdmin] < 1) return 0; // idx else { if(Counting) { KillTimer(CD); Counting = false; SendClientMessage(playerid, COLOR_RED, "-OperServ- Contagem Cancelada"); //Grey colour return 1; } if(!strlen(params) || !IsNumeric(params) || strval(params) < 1 || strval(params) > 10) return SendClientMessage(playerid, COLOR_GREY, "-OperServ- Uso: /contar [nъmero]"); Counting = true; new ii = strval(params); do { CD = SetTimerEx("CountDown", (strval(params) - ii) * 1000, false, "i", ii); ii --; } while (ii != -1); SendClientMessage(playerid, COLOR_GREEN, "-OperServ- Contagem Iniciada."); return 1; } } forward CountDown(num); public CountDown(num) { if(Counting == false) return 0; new str[256]; if(num) { format(str, sizeof(str), "~w~%d", num); GameTextForAll(str, 1001, 4); } else { GameTextForAll("~r~Vai vai vai!", 1001, 4); Counting = false; } return 1; } #endif
Код:
dcmd(contar, 6, cmdtext);