15.04.2014, 19:08
Hello,
I've been trying to fix this issue for a while. Before I start, I've already included the easyDialog.inc. I'm having an issue with getting the code to run. The dialogs show however the code under the dialogs don't. I've done some debugging and I know that the code doesn't execute.
I've been trying to fix this issue for a while. Before I start, I've already included the easyDialog.inc. I'm having an issue with getting the code to run. The dialogs show however the code under the dialogs don't. I've done some debugging and I know that the code doesn't execute.
pawn Code:
public OnAccountCheck(playerid)
{
print("OnAccountCheck() called");
new rows, fields, DialogS[356];
cache_get_data(rows, fields, dbHandle);
if(!rows) {
format(DialogS, sizeof(DialogS), "\n{0085BA}Player Registration\n{ffffff}Nick: {0085BA}%s{ffffff}\nYou must {ff0000}not{ffffff} register multiple account.\nYou must {ff0000}not{ffffff} use an insecure password.\nMinimum: {ff0000}6 Characters{ffffff}\n\nPlease Enter A {CCBB00}Password{ffffff} For Your Account:", ReturnPlayerName(playerid));
Dialog_Show(playerid, RegisterDialog, DIALOG_STYLE_PASSWORD, "LSCnR Registration", DialogS, "Register", "Cancel");
if(Dialog_Opened(playerid) == 1) {
print("Dialog Open.");
}
return 1;
}
else
{
format(DialogS, sizeof(DialogS), "\n{0085BA}Player Login\n{ffffff}This nick, {0085BA}%s{ffffff} is registered.\nIf this is not your account, please quit and change your nick.\n\nPlease Enter Your {CCBB00}Password{ffffff} To Login:", ReturnPlayerName(playerid));
Dialog_Show(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "LSCnR Login", DialogS, "Login", "Cancel");
return 1;
}
}
pawn Code:
Dialog:RegisterDialog(playerid, response, listitem, inputtext[])
{
if(!response)
{
AdminPunishment(playerid, "KICK", "Invalid Login");
KickPlayer(playerid);
return 1;
}
else if(response)
{
print("RegisterDialog() called.");
if(strlen(inputtext) <= 6) {
new DialogS[356];
format(DialogS, sizeof(DialogS), "\n{0085BA}Player Registration\n{ffffff}Nick: {0085BA}%s{ffffff}\nYou must {ff0000}not{ffffff} register multiple account.\nYou must {ff0000}not{ffffff} use an insecure password.\nMinimum: {ff0000}6 Characters{ffffff}\n{ff0000}Your password must be greater than 6 characters.{ffffff}\nPlease Enter A {CCBB00}Password{ffffff} For Your Account:", ReturnPlayerName(playerid));
Dialog_Show(playerid, RegisterDialog, DIALOG_STYLE_PASSWORD, "LSCnR Registration", DialogS, "Register", "Cancel");
}
new Query[90];
mysql_format(dbHandle, Query, sizeof(Query), "INSERT INTO `users`(`Username`, `Password`, `IP_Address`) VALUES('%s', MD5('%s'), '%s')", ReturnPlayerName(playerid), inputtext, ReturnPlayerIP(playerid));
mysql_tquery(dbHandle, Query, "", "");
GivePlayerMoney(playerid, 5000);
SendClientMessage(playerid, -1, "You have successfully registered.");
}
return 1;
}