SafeSystem problem
#1

Hi! I tried to make a SafeSystem for Gangs. First just to put money in it or out of it. So I made a /tresor ( Tresor = Safe ) Command with Dialog:

pawn Код:
if(dialogid == tresoreinzahlen)
    {
        if(response==0)
        {
            if(strlen(inputtext))
            {
                new File: hFile = fopen("cfg/tresorgang6.cfg", io_write);
                if (hFile)
                {
                    new key[ 256 ] , val[ 256 ];
                    new Data[ 256 ];
                    new Inputtext = strlen(inputtext)
                    while ( fread( hFile , Data , sizeof( Data ) ) )
                    {
                        key = ini_GetKey( Data );
                        new Betrag
                        if( strcmp( key , "Betrag" , true ) == 0 ) { val = ini_GetValue( Data ); Betrag = strval( val ); }
                        new var[64];
                        format(var, 64, "Betrag=%s\n", Betrag+Inputtext);fwrite(hFile, var);
                        GivePlayerMoney(playerid, -Betrag);
                    }
                }
            }
        }
    }
If I type /tresor einzahlen the Dialog appears. I enter f.E. 100$. Actually the "Betrag" in the .cfg File should change his value (+100$) and ingame it should change the money amount. (-100$). But that doesn't happens?!
Sry this is my first time doing something with files

Thanks for help!!
Danke fьr eure Hilfe im Vorraus
Reply
#2

No idea?!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)