Command will always show number 1 when it has to raise
#1

So I had problem with creating file but I figured it out (Thanks to Jakku). Well, now the problem is on the counting. I want it to count up, but for some reasons it will always count to 1.

This is the code I got.

pawn Код:
COMMAND:createconvoy(playerid, params[])
{
    new string[64], text[128], number[25];
    new File:convoys = fopen("ConvoyIDs.txt", io_read);
    if(convoys)
    {
        fread(convoys, string);
        format(number, sizeof(number), "%d", fread(convoys, string)+1);
        fwrite(convoys, number);
       
        PlayerInfo[playerid][pConvoy] = fread(convoys, string)+1;
       
        fclose(convoys);
       
        format(text, sizeof(text), "Convoy with ID %d has been created", fread(convoys, string)+1);
       
        print(text);
       

    }
    return 1;
}
Thanks in advance.
Reply


Messages In This Thread
Command will always show number 1 when it has to raise - by Private200 - 22.03.2014, 01:05
Re: Command will always show number 1 when it has to raise - by Aerotactics - 22.03.2014, 02:13
Re: Command will always show number 1 when it has to raise - by Private200 - 22.03.2014, 09:09

Forum Jump:


Users browsing this thread: 2 Guest(s)