Reading everything from a file
#1

Hey,
this is my code:
pawn Код:
forward Log(playerid,string[]);
public Log(playerid,string[])
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    new entry[200];
    format(entry, sizeof(entry), "%s\r\n",string);
    new f[200];
    format(f, sizeof(f), "Records/%s",pName);
    new File:hFile;
    hFile = fopen(f, io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
It works well everytime I use it, but I also wish to make a command or function which reads the file and writes back (in-game) the lines.c
For example, if in the file there are the following lines:
Quote:

X blah blah
Y blah blah
Iskeblahblah

The function will read from the file, and write back to the player in game:
Quote:

X blah blah
Y blah blah
Iskeblahblah

I hope you understood me, thank you in advance !
Reply


Messages In This Thread
Reading everything from a file - by MatanD - 13.10.2011, 15:24
Re: Reading everything from a file - by MatanD - 13.10.2011, 17:07

Forum Jump:


Users browsing this thread: 1 Guest(s)