Help not saving [Dini]
#1

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(string50"B_%s"playername);
          if(!
dini_Exists(AddDirFile(dir_bankfiles,string)))
          {
           
dini_Create(AddDirFile(dir_bankfilesstring));
           
temp1 dini_Int(AddDirFile(dir_bankfilesstring), "account");
           
dini_IntSet(AddDirFile(dir_bankfilesstring), "BankAccount"temp1);
           
SendClientMessage2(playeridCOLOR_GREEN"~ Account Registered.");
           
ShowPlayerDialog2(playeridDIALOG_BANKDIALOG_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(playeridpname1MAX_PLAYER_NAME);
            
format(str50"B_%s"pname1);
            if(!
dini_Exists(AddDirFile(dir_bankfiles,str)))
            {
             
ShowPlayerDialog2(playeridDIALOG_BANKREGDIALOG_STYLE_MSGBOX"San Andreas State Bank""You dont have bank account.\n\nWant to register bank account?""Yes""No");
            }
            else
            {
             
ShowPlayerDialog2(playeridDIALOG_BANKDIALOG_STYLE_LIST"San Andreas State Bank""Deposit\nWithdraw\nBalance\nSend Money\nCollect Interest\nCheck State""Select""Close");
            } 
Reply
#2

Can you show the OnDialogResponse part for the register dialog?
Reply
#3

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_datafilesFILE_TOTALSTAT), "regdis"))
                return 
SendClientMessage2(playeridCOLOR_RED"Registration is currently disabled. Please try again later.");
            
temp1 dini_Int(AddDirFile(dir_datafilesFILE_TOTALSTAT), "users");
            if (
temp1 == 99999999)
                return 
SendClientMessage2(playeridCOLOR_RED"Max account limit reached.");
            if (
strlen(inputtext) < || strlen(inputtext) > 18) {
                
ShowPlayerDialog2(playeridDIALOG_REGISTERDIALOG_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(playeridCOLOR_RED"Your password must be between 6-18 characters.");
                return 
1;
            }
            
SetPVarInt(playerid"confirmpass"num_hash(inputtext));
            
ShowPlayerDialog2(playeridDIALOG_REGISTER_CONFIRMDIALOG_STYLE_PASSWORD"Register an account""Please confirm your password.""Register""Cancel");
        }
        else {
            
SendClientMessage2(playeridCOLOR_WHITE"You must register to play! Type /register to continue.");
        }
        return 
1;
    } 
Reply
#4

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.
Reply
#5

I didn't mean this one.
I mean the DIALOG_BANKREG one.
Reply
#6

Quote:
Originally Posted by XavierJ
Посмотреть сообщение
I didn't mean this one.
I mean the DIALOG_BANKREG one.
i already gve bro
Reply
#7

Quote:
Originally Posted by BulletRaja
Посмотреть сообщение
i already gve bro
nope u showed DIALOG_REGISTER
Reply
#8

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)