PDA

View Full Version : easyDialog issue.


Isolated
15/04/2014, 08:08 PM
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.

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;
}
}



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;
}

MrCallum
15/04/2014, 10:15 PM
Try defining some shizzle with some extra strings?

Isolated
03/08/2014, 06:11 PM
Still a problem. Bump..

ViniBorn
03/08/2014, 06:28 PM
Show the debug

Isolated
03/08/2014, 06:33 PM
Thanks for the help but I've completely given up with easyDialog.

CutX
03/08/2014, 06:45 PM
//EDIT: just checked emmet's post & it seems like i've got an older version here... but hey.. it's working, wanna have it?

whats this "Dialog_Show" ? isn't it "ShowDialog" ?

not sure, i was away for a long time but i remember it being like this:

calling a dialog
ShowDialog(playerid, Show:Stats, DIALOG_STYLE_MSGBOX,"Your Stats",s,"Ok","");

and the code like this
Dialog:Stats(playerid, response, listitem, inputtext[])
{
//your code
return 1;
}

& it works like a charm, even today after so many months its still working (well, why not xD)

Isolated
03/08/2014, 08:59 PM
Yeah mate, if you could upload that and PM me a link I'd be really grateful.

CutX
03/08/2014, 09:12 PM
Yeah mate, if you could upload that and PM me a link I'd be really grateful.

check your inbox ;)