SA-MP Forums Archive
Offline trasfer bank [Y_INI] [ZCMD] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Offline trasfer bank [Y_INI] [ZCMD] (/showthread.php?tid=570351)



Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 09.04.2015

Hi all.

I created this:

PHP код:
case DIALOG_BANCA_BONIFICO_2:
        {
            if(
response)
            {
                new 
denaro = Somma[playerid];
                
                new 
string[MAX_PLAYER_NAME+18];
                
                if(
strlen(inputtext) == 0) return SendClientMessageEx(playerid, -1, "Devi inserire il nome del beneficiario!");
                
                
format(string, sizeof(string), PATH, inputtext);
                 
                 if(!
fexist(string)) return SendClientMessageEx(playerid, -1, "Il nome inserito и inesistente.");
                 
                new 
id;
                
                
INI_ParseFile(string, "LoadUser_%s", .bExtra = true, .extra = id );
                
PlayerInfo[id][Banca] += denaro;
                 new 
INI:File = INI_Open(string);
                
INI_WriteInt(File, "Banca", PlayerInfo[id][Banca]);
                
                
INI_Close(File);
                
                
PlayerInfo[playerid][Banca] -= denaro;
                
                
SalvaDati(playerid);
                
                new 
string2[150];
                
                
format(string2, sizeof(string2), "Hai effettuato un bonifico bancario di %d dollari a %s.", denaro, inputtext);
                
SendClientMessageEx(playerid, -1, string2);
            }
        } 
But it don't work very well. It set MONEY and not get the money that the player has.

Example: Lossa has 5.000 $ into the bank. Lusso give her 1.000$ by transfer. Now Lossa has 1.000$ and not 6.000$ What I've to do?

I'm using ZCMD and Y_INI.

Thank you.


Re: Offline trasfer bank [Y_INI] [ZCMD] - Boyka96 - 09.04.2015

I'm not familiar with file saving systems, but I believe that the script overwrites the bank value instead of adding the ammout to it.

try this (this isnt a solution, just to know where the problem is)

PlayerInfo[id][Banca] += denaro;
printf("Bank test: %i", PlayerInfo[id][Banca]);// go check the server console for details

P.S: you may want to post the results here


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 09.04.2015

I have put 250 and it say:

Bank test: 250

It's right. So why?


Another bug. It set my money to 0.

If I have 5.000 and I pay 50, It set my money to 0.


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 09.04.2015

What I have to do?


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 11.04.2015

Help me please


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 13.04.2015

So?


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 14.04.2015

UPPED


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 15.04.2015

WWWW


Re: Offline trasfer bank [Y_INI] [ZCMD] - DarkLouis - 16.04.2015

Hey. Can Simeone help me?