30.11.2011, 12:06
pawn Код:
stock IsARoleplayName(playerid)
{
new strg[24],underscore;
GetPlayerName(playerid, strg, 24);
if(strg[0] < 'A' || strg[0] > 'Z') return false;
for(new i = 1; i < 24; i++)
{
switch(strg[i])
{
case '\0':
{
if(i < 2) return false;
return true;
}
case 'a'..'z': continue;
case '_':
{
underscore++;
if(underscore == 2) return false;
i++;
if(strg[i] < 'AA' || strg[i] > 'Z') return false;
}
default: return false;
}
}
return true;
}