12.10.2011, 22:07
Po vini olha como eu fiz:
Sу que deu erro na linha "new Vstring[15] = pemail;" diz que: "must be a constant expression; assumed zero"
pawn Код:
if(dialogid == 10105) // Email
{
if (response)
{
new pemail[MAX_PLAYER_EMAIL], tamanho = 0;
format(pemail,40, "%s", inputtext); tamanho = strlen(pemail);
if (!strlen(inputtext))
{
format(strres, 128, "Digite o seu email:");
ShowPlayerDialog(playerid, 10105, DIALOG_STYLE_INPUT,"Email", strres, "Confirmar", "");
return 1;
}
if (tamanho < 10 || tamanho > 40)
{
format(strres, 128, "Digite o seu email:");
ShowPlayerDialog(playerid, 10105, DIALOG_STYLE_INPUT,"Email", strres, "Confirmar", "");
return 1;
}
new Vstring[15] = pemail;
new Contador;
for(new i=0; i<sizeof Vstring; i++)
{
if(Vstring[i] == '@')
{
Contador++;
}
}
if(Contador > 1)
{
format(strres, 128, "Digite o seu email:");
ShowPlayerDialog(playerid, 10105, DIALOG_STYLE_INPUT,"Email", strres, "Confirmar", "");
return 1;
}
bd_escrever_str(pName(playerid),"Email", pemail);
SendClientMessage(playerid, COR_VERDE, "| Email cadastrado com sucesso!");
OnPlayerCommandText(playerid, "/regras");
}
else
{
format(strres, 128, "Digite o seu email:");
ShowPlayerDialog(playerid, 10105, DIALOG_STYLE_INPUT,"Email", strres, "Confirmar", "");
}
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}