string overwrites the last one in file
#1

when creating an object, it overwrites the previous one

pawn Код:
if(dialogid == OBIEKT2)
    {
        if(response)
        {
            new object = 0;
            if(IsNumeric(inputtext) || strval(inputtext) > 0 || strval(inputtext) < 19470)
            {
                object ++;
                new File:hFile;
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                new obj2[MAX_OBJECTS_2];
                SelectedO[playerid] = object;
                Selected1[playerid] = strval(inputtext);
                obj2[object] = CreateObject(strval(inputtext), X+1, Y+1, Z+1, 0.0,0.0,0.0);
                EditObject(playerid, obj2[object]);
                hFile = fopen("/Ustawienia/obiekty.ini", io_write);
                new line[128];
                format(line, sizeof(line), "%d,%f,%f,%f,%f,%f,%f,%d\r\n",strval(inputtext), X+1,Y+1,Z+1, 0,0,0,object);
                fwrite(hFile, line);
                return 1;
            }
        }
    }
Reply


Messages In This Thread
string overwrites the last one in file - by HondaCBR - 10.04.2012, 23:41
Re: string overwrites the last one in file - by ReneG - 10.04.2012, 23:50
Re: string overwrites the last one in file - by HondaCBR - 11.04.2012, 00:08
Re: string overwrites the last one in file - by ReneG - 11.04.2012, 00:22
Re: string overwrites the last one in file - by HondaCBR - 11.04.2012, 00:33
Re: string overwrites the last one in file - by ReneG - 11.04.2012, 00:52
Re: string overwrites the last one in file - by HondaCBR - 11.04.2012, 01:31

Forum Jump:


Users browsing this thread: 2 Guest(s)