What is problem in this one
#4

pawn Код:
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;
}
Reply


Messages In This Thread
Nick Change to BannedPlayer - by Lloyde - 02.11.2016, 08:44
Re: What is problem in this one - by justjamie - 02.11.2016, 09:09
Re: What is problem in this one - by Lloyde - 02.11.2016, 09:16
Re: What is problem in this one - by Lloyde - 02.11.2016, 09:18
Re: What is problem in this one - by Lloyde - 03.11.2016, 09:53
Re: What is problem in this one - by SuperTramp - 06.02.2017, 15:34

Forum Jump:


Users browsing this thread: 2 Guest(s)