#1

https://sampwiki.blast.hk/wiki/Fopen

But, i created this:
Код:
new File:string1 = fopen("varuserverlogi.log", io_write);
fwrite(string1, "Server started!\n");
fclose(string1);
And i restart 2x server, now i open that file, but theres 1x line, must be it 2x line?
Reply
#2

Try:
pawn Код:
if(fexist("blahblah.log(or what)")) string1 = fopen("blahblah.log(or what)", io_append);
Reply
#3

new Filetring1 = fopen("varuserverlogi.log", io_append);

tryed, but same it line.
Reply
#4

Can anyone help to fix that:
Код:
public VaruServerilogi1()
{
	if(StringerServer == 1)
	{
	  if(fexist("varuserverlogi.log"))
	  {
			new File:string1 = fopen("varuserverlogi.log", io_write);
  			if(fexist("varuserverlogi.log")) string1 = fopen("varuserverlogi.log", io_append);
			fwrite(string1, "Server started!\n");
			fclose(string1);
			print("[VARUSERVERILOGI] - FILE WRITTED!");
			StringerServer = 0;
		}
		else
		{
		  print("------------------ERROR-------------------");
		  print("-FILE DOENST EXIST'S! STOPPING TO WORKING!-");
		  print("------------------ERROR-------------------");
		  SendRconCommand("exit");
		}
		return 1;
	}
	return 1;
}
It must be write like add "Server started!" in file. Not overwrite it 1x line.
Reply
#5

You mean this?
pawn Код:
public VaruServerilogi1()
{
    if(StringerServer == 1)
    {
            new File:string1;
            if(fexist("varuserverlogi.log")) string1 = fopen("varuserverlogi.log", io_append);
            else string1 = fopen("varuserverlogi.log", io_write);
            fwrite(string1, "Server started!\n");
            fclose(string1);
            print("[VARUSERVERILOGI] - FILE WRITTED!");
            StringerServer = 0;

    }
    return 1;
}
Reply
#6

tryed this, didnt writted to file...

and this print didnt printed..
Reply
#7

Then the mistake is in your script... On a different place maybe.
Reply
#8

Код:
public OnGameModeInit()
{
   VaruServerilogi1();
}
Reply
#9

pawn Код:
public VaruServerilogi1()
{
new File:string1;
if(fexist("varuserverlogi.log")) string1 = fopen("varuserverlogi.log", io_append);
else string1 = fopen("varuserverlogi.log", io_write);
fwrite(string1, "Server started!\n");
fclose(string1);
print("[VARUSERVERILOGI] - FILE WRITTED!");
}
return 1;
}
This is the last chance.
Reply
#10

Thanks, now working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)