fWrite / Top Line - 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: fWrite / Top Line (
/showthread.php?tid=444512)
fWrite / Top Line -
Glad2BeHere - 17.06.2013
Is it possible to make fwrite... write to the top line.... or is there a another method... yep its to a .txt file
Re: fWrite / Top Line -
Ballu Miaa - 17.06.2013
Yo bro whatsup? I did not understand you properly i guess. Hope you can show an example code.
Re: fWrite / Top Line -
Glad2BeHere - 17.06.2013
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
Re: fWrite / Top Line -
Ballu Miaa - 17.06.2013
Why dont you set the count to 10 and decrement its value to 1 in the end. What are you trying to count actually?
Re: fWrite / Top Line -
Glad2BeHere - 17.06.2013
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