fWrite / Top Line
#1

Is it possible to make fwrite... write to the top line.... or is there a another method... yep its to a .txt file
Reply
#2

Yo bro whatsup? I did not understand you properly i guess. Hope you can show an example code.
Reply
#3

pawn Код:
new count;
public OnGameModeInit()
{
    new File:log = fopen("/ServerLog.txt", io_write); // Open the file
    if(log)
    {
        new string[100];
        count ++;
        format(string, 100, ""Server Started %d", count);
        fwrite(log, "
Server started.\r\n"); // Write to the file (\r\n is for a new line)
        fclose(log); // Close the file
    }
    return 1;
}
Each time u start the server the count goes up... so i want to know if there is a way to read the file backwards such as 10,9,8,7,6..... as in the 10 would be at the top to the last variable being 1... if u understand what i mean
Reply
#4

Why dont you set the count to 10 and decrement its value to 1 in the end. What are you trying to count actually?
Reply
#5

Can't i wanted to use it for text for some php work i was doing... but thank good for php there is a simple function i can use called "array_reverse" .... Wanted to Create a Readable chat box and rewrite a samp function to make a nice friend user base... To release.... cause im learning Web Dev as well now :/ ... trying to understand html... problem solved but thanx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)