28.01.2014, 16:06
pawn Код:
stock isValidName(const sz_Name[])
{
new
lenght = strlen(sz_Name);
if (!lenght) return 0;
new
us_count;
for (new i; i != lenght; ++i)
{
if (sz_Name[i] == '_') ++us_count;
}
return (us_count == 1 && sz_Name[0] != '_' && sz_Name[lenght - 1] != '_');
}
pawn Код:
if (!isValidName(inputtext))
{
SendClientMessage(playerid, -1, "You have entered bad format of name!");
return ShowPlayerDialog (playerid, 3, DIALOG_STYLE_LIST, "Sprбvca postбv", "Načнtavanie postбv\nVytvorenie postбv\nVymazanie Postбv", "Potvrdiť", "Zruљiť");
}
else
{
SendClientMessage(playerid, -1, "Correct format");
ShowPlayerDialog (playerid, 3, DIALOG_STYLE_LIST, "Sprбvca postбv", "Načнtavanie postбv\nVytvorenie postбv\nVymazanie Postбv", "Potvrdiť", "Zruљiť");
}