SA-MP Forums Archive
SafeSystem problem - 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: SafeSystem problem (/showthread.php?tid=280859)



SafeSystem problem - xXGaryXx - 03.09.2011

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


AW: SafeSystem problem - xXGaryXx - 04.09.2011

No idea?!