RolePlay Name
#4

Function CheckPlayerName.
pawn Код:
stock CheckPlayerName(const name[])
{
    if (strlen(name) < 6) return 0;
    if (strfind(name, "_", true) == -1) return 0;
    new underscorecount, expectinguppercase = 1;
    for (new i = 0, j = strlen(name); i < j; i++)
    {
        if (expectinguppercase == 1)
        {
            if (name[i] < 'A' || name[i] > 'Z') return 0;
            expectinguppercase = 0;
            continue;
        }
        switch (name[i])
        {
            case '_':
            {
                if (underscorecount == 1) return 0;
                else
                {
                    underscorecount = 1;
                    expectinguppercase = 1;
                }
                continue;
            }
            case 'A' .. 'Z': continue;
            case 'a' .. 'z': continue;
            default: return 0;
        }
    }
    return 1;
}
}
Reply


Messages In This Thread
RolePlay Name - by WhiteAngels - 25.08.2014, 11:46
Re: RolePlay Name - by FloxX - 25.08.2014, 11:49
Re: RolePlay Name - by JeevanJyothish - 25.08.2014, 11:50
Re: RolePlay Name - by Thogy - 25.08.2014, 11:51
Re: RolePlay Name - by WhiteAngels - 25.08.2014, 12:31

Forum Jump:


Users browsing this thread: 1 Guest(s)