21.07.2014, 05:06
Tem alguma coisa errada aqui, sempre kika mas nгo avisa sobre o nome invбlido
Код:
stock InvalidNameCheck(playerid) { new szPlayerName[MAX_PLAYER_NAME], arrForbiddenNames[][] = { "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "nul", "clock$", "aux", "prn", "con", "InvalidNick", "BannedPlayer" }, iLength, i; GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName)); iLength = strlen(szPlayerName); while(i < sizeof(arrForbiddenNames)) if(strcmp(arrForbiddenNames[i++], szPlayerName, true) == 0) { SetPlayerName(playerid, "InvalidNick"); SendClientMessage(playerid, COLOR_NEWS, "You have been kicked for using an invalid name."); Kick(playerid); return 0; } if(szPlayerName[iLength - 1] == '_' || szPlayerName[0] == '_' || strfind(szPlayerName, "_", false) == -1) { SendClientMessage(playerid, COLOR_NEWS, "You have been kicked for failing to connect with a role play name (i.e. John_Smith)."); SetPlayerName(playerid, "InvalidNick"); Kick(playerid); return 0; } return 1; }