CheckPassword(string[]) { for(new i = strlen(string); i > 0; i--) if(!('A' <= string[i] <= 'Z') && !('a' <= string[i] <= 'z') && !('0' <= string[i] <= '9')) return false; return true; }
new pKick[MAX_PLAYERS]; if(CheckPassword(inputtext)) { His password only contains Alphabets + numbers do your code now } else { His password has some symbols or other language words, pKick[playerid] ++ ; // Adding +1 to his warning if(pKick[playerid] >= 10) // He've done this for more than 10 times { Kick(playerid); // Kicking him } }
Код:
CheckPassword(string[]) { for(new i = strlen(string); i > 0; i--) if(!('A' <= string[i] <= 'Z') && !('a' <= string[i] <= 'z') && !('0' <= string[i] <= '9')) return false; return true; } Код:
new pKick[MAX_PLAYERS]; if(CheckPassword(inputtext)) { His password only contains Alphabets + numbers do your code now } else { His password has some symbols or other language words, pKick[playerid] ++ ; // Adding +1 to his warning if(pKick[playerid] >= 10) // He've done this for more than 10 times { Kick(playerid); // Kicking him } } |
if(dialogid == 1) { if(!response) { SetTimerEx("DialogLogin", 100, 0, "d", playerid); return 1; } if(!strlen(inputtext)) { SetTimerEx("DialogLogin", 100, 0, "d", playerid); return 1; } if(CheckPassword(inputtext)) //аЄз¤ГЛСКјиТ№ { OnPlayerLogin(playerid,inputtext); } else { SendClientMessage(playerid, COLOR_GRAD1, "ГЛСКјиТ№ЁРµйН§дБиБХµСЗНСЎЙГѕФаИЙ ЁРµйН§БХ A-Z бЕР µСЗаЕўа·иТ№Сй№"); SetTimerEx("DialogLogin", 100, 0, "d", playerid); pKick[playerid] ++ ; // Adding +1 to his warning if(pKick[playerid] >= 10) // He've done this for more than 10 times { Kick(playerid); // Kicking him } return 1; } return 1; }
if(dialogid == 2) { if(!response) { SetTimerEx("DialogRegister", 100, 0, "d", playerid); return 1; } if(!strlen(inputtext)) { SetTimerEx("DialogRegister", 100, 0, "d", playerid); return 1; } if(strlen(inputtext) < 3 || strlen(inputtext) > 20) { SetTimerEx("DialogRegister", 100, 0, "d", playerid); SendClientMessage(playerid, COLOR_GRAD1, "ГЛСКјиТ№ЁРµСй§дґйµСй§бµи 3 - 20 µСЗНСЎЙГа·иТ№Сй№"); return 1; } if(CheckPassword(inputtext)) //аЄз¤ГЛСКјиТ№ { OnPlayerRegister(playerid,inputtext); } else { SendClientMessage(playerid, COLOR_GRAD1, "ГЛСКјиТ№ЁРµйН§дБиБХµСЗНСЎЙГѕФаИЙ ЁРµйН§БХ A-Z бЕР µСЗаЕўа·иТ№Сй№"); SetTimerEx("DialogRegister", 100, 0, "d", playerid); pKick[playerid] ++ ; // Adding +1 to his warning if(pKick[playerid] >= 10) // He've done this for more than 10 times { Kick(playerid); // Kicking him } return 1; } return 1; }
if(dialogid == 3) { if(response) { SetTimerEx("DialogLogin", 1000, 0, "d", playerid); } if(CheckPassword(inputtext)) //аЄз¤ГЛСКјиТ№ { OnPlayerRegister(playerid,inputtext); } else { SendClientMessage(playerid, COLOR_GRAD1, "ГЛСКјиТ№ЁРµйН§дБиБХµСЗНСЎЙГѕФаИЙ ЁРµйН§БХ A-Z бЕР µСЗаЕўа·иТ№Сй№"); SetTimerEx("DialogLogin", 1000, 0, "d", playerid); pKick[playerid] ++ ; // Adding +1 to his warning if(pKick[playerid] >= 10) // He've done this for more than 10 times { Kick(playerid); // Kicking him } return 1; } }