28.01.2014, 15:49
Hm, I still got one problem.. When I type to inputtext as first character the underscore (_) it will detect him.. But when I type after underscore some text (string) like _world it will still detect it as correct.. Adding code
Dont worry about dialog lang I translated messages / other stuff..
pawn Код:
case 7:
{
if (response)
{
if(sscanf(inputtext, "{p<_>s[9]s[9]}"))
{
new TEXT[MAX_PLAYER_NAME], underscorecount;
format (TEXT, sizeof (TEXT), "%s", inputtext);
for (new i; i < MAX_PLAYER_NAME; i++)
{
if (TEXT[i] == '_')
underscorecount++;
}
if (underscorecount > 1)
{
SendClientMessage (playerid, -1, "two underscores found!");
}
if (TEXT[0] == '_')
{
SendClientMessage(playerid, -1, "underscore is located in first place in inputtext!");
return ShowPlayerDialog (playerid, 3, DIALOG_STYLE_LIST, "Sprбvca postбv", "Načнtavanie postбv\nVytvorenie postбv\nVymazanie Postбv", "Potvrdiť", "Zruљiť");
}
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ť");
}
}