[HOWTO]Creating a little script.
#7

Quote:
Originally Posted by (SF)Noobanatior
pawn Код:
stock Validrpname(rpname[]) {
    new len=strlen(rpname);
    new cstate=0;
    new i;
    for(i=0;i<len;i++) {
        if ((cstate==0 || cstate==1) && (rpname[i]>='A' && rpname[i]<='Z') || (rpname[i]>='a' && rpname[i]<='z'))continue;
    else {
   // Ok no A..Z,a..z
        if ((cstate==0) &&(email[i]=='_')) {
     // its an _ after the name, ok state=1;
            cstate=1;
        }
            else return false; // Its stuff which is not allowed
        }
    }
    if (cstate<1) return false;
    else if (len<6) return false; //name must be at least 6 char
    else return true;
}
it dont look for the caps at the start of name can add though
Ehh this kick players if there name is Jhon_Doe because it kicks on capitals.. (or I am crazy)
Reply


Messages In This Thread
[HOWTO]Creating a little script. - by Visualbr - 29.05.2010, 10:59
Re: [HOWTO]Creating a little script. - by (SF)Noobanatior - 29.05.2010, 11:07
Re: [HOWTO]Creating a little script. - by playbox12 - 29.05.2010, 11:15
Re: [HOWTO]Creating a little script. - by Calgon - 29.05.2010, 11:18
Re: [HOWTO]Creating a little script. - by Visualbr - 29.05.2010, 11:22
Re: [HOWTO]Creating a little script. - by (SF)Noobanatior - 29.05.2010, 11:25
Re: [HOWTO]Creating a little script. - by playbox12 - 29.05.2010, 11:27
Re: [HOWTO]Creating a little script. - by (SF)Noobanatior - 29.05.2010, 11:29

Forum Jump:


Users browsing this thread: 1 Guest(s)