06.07.2010, 18:48
Hey everyone... I'm looking for a valid name check public which checks if the playername contains a form like this:
Firstname_Lastname
Not FirstName_LaStname or something like that.... Right now I'm checking for the "_"... But I want to check for capitals too... How to do this?
Firstname_Lastname
Not FirstName_LaStname or something like that.... Right now I'm checking for the "_"... But I want to check for capitals too... How to do this?
pawn Код:
stock IsValidName(playerid)
{
if (IsPlayerConnected(playerid))
{
new player[24];
GetPlayerName(playerid,player,24);
for(new n = 0; n < strlen(player); n++)
{
if (player[n] == '_') return 1;
if (player[n] == ']' || player[n] == '[') return 0;
}
}
return 0;
}