Anyone got a IsValidName stock?
#5

Quote:
Originally Posted by mprofitt
Посмотреть сообщение
You got to be kidding me.....

There are much better exmples else where on the forum. Your function considers anything with a _ as a vailid name, everything thing else fails, as your script does.
Mhm, My script eh ?, Thats what i have in my Script

PHP код:
public IsValidName(playerid)
{
    new 
pname[MAX_PLAYER_NAME],underline=0;
    
GetPlayerName(playeridpnamesizeof(pname));
    if(
strfind(pname,"[",true) != (-1)) return 0;
    else if(
strfind(pname,".",true) != (-1)) return 0;
    else if(
strfind(pname,"]",true) != (-1)) return 0;
    else if(
strfind(pname,"$",true) != (-1)) return 0;
    else if(
strfind(pname,"(",true) != (-1)) return 0;
    else if(
strfind(pname,")",true) != (-1)) return 0;
    else if(
strfind(pname,"=",true) != (-1)) return 0;
    else if(
strfind(pname,"@",true) != (-1)) return 0;
    else if(
strfind(pname,"1",true) != (-1)) return 0;
    else if(
strfind(pname,"2",true) != (-1)) return 0;
    else if(
strfind(pname,"3",true) != (-1)) return 0;
    else if(
strfind(pname,"4",true) != (-1)) return 0;
    else if(
strfind(pname,"5",true) != (-1)) return 0;
    else if(
strfind(pname,"6",true) != (-1)) return 0;
    else if(
strfind(pname,"7",true) != (-1)) return 0;
    else if(
strfind(pname,"8",true) != (-1)) return 0;
    else if(
strfind(pname,"9",true) != (-1)) return 0;
    new 
maxname strlen(pname);
    for(new 
i=0i<maxnamei++) { if(pname[i] == '_'underline ++; }
    if(
underline != 1) return 0;
    
pname[0] = toupper(pname[0]);
    for(new 
x=1x<maxnamex++)
    {
        if(
pname[x] == '_'pname[x+1] = toupper(pname[x+1]);
         else if(
pname[x] != '_' && pname[x-1] != '_'pname[x] = tolower(pname[x]);
    }
    
SetPlayerName(playerid"New_Name");
    
SetPlayerName(playeridpname);
    return 
1;

So, Don't spam bro , Get proof, before trying to compete with me
Reply


Messages In This Thread
Anyone got a IsValidName stock? - by Snipa - 25.08.2011, 22:52
Re: Anyone got a IsValidName stock? - by =WoR=G4M3Ov3r - 25.08.2011, 22:55
Re: Anyone got a IsValidName stock? - by Snipa - 25.08.2011, 22:56
Re: Anyone got a IsValidName stock? - by mprofitt - 25.08.2011, 23:05
Re: Anyone got a IsValidName stock? - by =WoR=G4M3Ov3r - 25.08.2011, 23:07
Re: Anyone got a IsValidName stock? - by Snipa - 25.08.2011, 23:36
Re: Anyone got a IsValidName stock? - by =WoR=G4M3Ov3r - 25.08.2011, 23:39
Re: Anyone got a IsValidName stock? - by Bakr - 26.08.2011, 00:05
Re: Anyone got a IsValidName stock? - by =WoR=G4M3Ov3r - 26.08.2011, 00:12
Re: Anyone got a IsValidName stock? - by Bakr - 26.08.2011, 00:29

Forum Jump:


Users browsing this thread: 3 Guest(s)