Offline trasfer bank [Y_INI] [ZCMD]
#1

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(stringsizeof(string), PATHinputtext);
                 
                 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(string2sizeof(string2), "Hai effettuato un bonifico bancario di %d dollari a %s."denaroinputtext);
                
SendClientMessageEx(playerid, -1string2);
            }
        } 
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.
Reply
#2

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
Reply
#3

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

What I have to do?
Reply
#5

Help me please
Reply
#6

So?
Reply
#7

UPPED
Reply
#8

WWWW
Reply
#9

Hey. Can Simeone help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)