Help not saving [Dini] -
BulletRaja - 19.01.2018
hello guys i created bank register system but this system is not saving the player account in files so help
PHP код:
if (dialogid == DIALOG_BANKREG)
{
if (response)
{
format(string, 50, "B_%s", playername);
if(!dini_Exists(AddDirFile(dir_bankfiles,string)))
{
dini_Create(AddDirFile(dir_bankfiles, string));
temp1 = dini_Int(AddDirFile(dir_bankfiles, string), "account");
dini_IntSet(AddDirFile(dir_bankfiles, string), "BankAccount", temp1);
SendClientMessage2(playerid, COLOR_GREEN, "~ Account Registered.");
ShowPlayerDialog2(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "San Andreas State Bank", "Deposit\nWithdraw\nBalance\nSend Money\nCollect Interest\nCheck State", "Select", "Close");
}
}
return 1;
}
here when the player go in marker he get this dialog and when he click on register the acc is not saving
PHP код:
new str[1080], pname1[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname1, MAX_PLAYER_NAME);
format(str, 50, "B_%s", pname1);
if(!dini_Exists(AddDirFile(dir_bankfiles,str)))
{
ShowPlayerDialog2(playerid, DIALOG_BANKREG, DIALOG_STYLE_MSGBOX, "San Andreas State Bank", "You dont have bank account.\n\nWant to register bank account?", "Yes", "No");
}
else
{
ShowPlayerDialog2(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "San Andreas State Bank", "Deposit\nWithdraw\nBalance\nSend Money\nCollect Interest\nCheck State", "Select", "Close");
}
Re: Help not saving [Dini] -
XavierJ - 19.01.2018
Can you show the OnDialogResponse part for the register dialog?
Re: Help not saving [Dini] -
BulletRaja - 20.01.2018
Quote:
Originally Posted by XavierJ
Can you show the OnDialogResponse part for the register dialog?
|
PHP код:
if (dialogid == DIALOG_REGISTER)
{
if (response)
{
if (dini_Isset(AddDirFile(dir_datafiles, FILE_TOTALSTAT), "regdis"))
return SendClientMessage2(playerid, COLOR_RED, "Registration is currently disabled. Please try again later.");
temp1 = dini_Int(AddDirFile(dir_datafiles, FILE_TOTALSTAT), "users");
if (temp1 == 99999999)
return SendClientMessage2(playerid, COLOR_RED, "Max account limit reached.");
if (strlen(inputtext) < 6 || strlen(inputtext) > 18) {
ShowPlayerDialog2(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register an account", "You must register an account to play in this server.\n\nType a password below to register an account.\n\n{E60026}Password length must be between 6-18 chars.", "Continue", "Cancel");
SendClientMessage2(playerid, COLOR_RED, "Your password must be between 6-18 characters.");
return 1;
}
SetPVarInt(playerid, "confirmpass", num_hash(inputtext));
ShowPlayerDialog2(playerid, DIALOG_REGISTER_CONFIRM, DIALOG_STYLE_PASSWORD, "Register an account", "Please confirm your password.", "Register", "Cancel");
}
else {
SendClientMessage2(playerid, COLOR_WHITE, "You must register to play! Type /register to continue.");
}
return 1;
}
Re: Help not saving [Dini] -
jasperschellekens - 20.01.2018
I have had this problem once.
Are you 100 percent sure that the folders you are using to be saved in really exist?
If you are using linux its case sensitive.
9 of the 10 times stuff didnt change for me was because the folder didnt exist or it wasnt capitalized.
Re: Help not saving [Dini] -
XavierJ - 20.01.2018
I didn't mean this one.
I mean the DIALOG_BANKREG one.
Re: Help not saving [Dini] -
BulletRaja - 20.01.2018
Quote:
Originally Posted by XavierJ
I didn't mean this one.
I mean the DIALOG_BANKREG one.
|
i already gve bro
Re: Help not saving [Dini] -
jasperschellekens - 20.01.2018
Quote:
Originally Posted by BulletRaja
i already gve bro
|
nope u showed DIALOG_REGISTER
Re: Help not saving [Dini] -
mongi - 20.01.2018
I believe i know this "AddDirFile" Function and it might be the problem
Inside your bank files folder, Add an other folder called "B"
That function takes the first letter (Char) of the string and uses it as a folder (To organize accounts by name usually)