26.12.2012, 00:27
This code do not compile to me:
I try solve it putting short line codes doing that:
But nothing. Help me please, if I compile the code the compiler stop responding and I have to kill the pawncc.exe process to continue :/
Thanks.
pawn Код:
if(dialogid == MAIL)
{
if(response)
{
if(strlen(inputtext))
{
if(strfind(inputtext, "@", false) != -1 && strfind(inputtext, ".", false) != -1)
{
new mysql_name[MAX_PLAYER_NAME];
mysql_real_escape_string(inputtext, PlayerData[playerid][pMail]);
mysql_real_escape_string(GetName(playerid), mysql_name);
format(string, 90, "UPDATE users SET Mail='%s' WHERE Name='%s'", PlayerData[playerid][pMail], mysql_name);
mysql_function_query(1, string, false, "OnPlayerPutMail", "i", playerid);
}
else ShowPlayerDialog(playerid, MAIL, DIALOG_STYLE_INPUT, ""yellow"Register", ""red"ERROR: You have to put a valid email address.\n\n"white"Now you have to put a valid email address to recover the password if you have forgot it and the server will send you a lot of information, news, updates, etc.\n\n"yellow"If you don't want receive emails from the server you can desactivate it by the player menu (/config)", "Accept", "");
}
else ShowPlayerDialog(playerid, MAIL, DIALOG_STYLE_INPUT, ""yellow"Register", ""red"ERROR: You have to put a valid email address.\n\n"white"Now you have to put a valid email address to recover the password if you have forgot it and the server will send you a lot of information, news, updates, etc.\n\n"yellow"If you don't want receive emails from the server you can desactivate it by the player menu (/config)", "Accept", "");
}
else ShowPlayerDialog(playerid, MAIL, DIALOG_STYLE_INPUT, ""yellow"Register", ""red"ERROR: You have to put a valid email address.\n\n"white"Now you have to put a valid email address to recover the password if you have forgot it and the server will send you a lot of information, news, updates, etc.\n\n"yellow"If you don't want receive emails from the server you can desactivate it by the player menu (/config)", "Accept", "");
return 1;
}
I try solve it putting short line codes doing that:
pawn Код:
if(dialogid == MAIL)
{
#define s ShowPlayerDialog
#define p playerid
#define d MAIL
#define s DIALOG_STYLE_INPUT
#define r "Register"
#define t ""red"ERROR: You have to put a valid email address.\n\n"white"Now you have to put a valid email address to recover the password if you have forgot it and the server will send you a lot of information, news, updates, etc.\n\n"yellow"If you don't want receive emails from the server you can desactivate it by the player menu (/config)"
if(response)
{
if(strlen(inputtext))
{
if(strfind(inputtext, "@", false) != INVALID && strfind(inputtext, ".", false) != INVALID)
{
new mysql_name[MAX_PLAYER_NAME];
mysql_real_escape_string(GetName(playerid), mysql_name);
mysql_real_escape_string(inputtext, PlayerData[playerid][pMail]);
format(string, 90, "UPDATE users SET Mail='%s' WHERE Name='%s'", PlayerData[playerid][pMail], mysql_name);
mysql_function_query(1, string, false, "OnPlayerPutMail", "i", playerid);
}
else s(p, d, s, r, t, "Accept", "");
}
else s(p, d, s, r, t, "Accept", "");
}
else s(p, d, s, r, t, "Accept", "");
#undef s
#undef p
#undef d
#undef s
#undef r
#undef t
return 1;
}
But nothing. Help me please, if I compile the code the compiler stop responding and I have to kill the pawncc.exe process to continue :/
Thanks.