[help] FS has no errors but crashes server ...
#1

Has no errors, and don't seem to know where the problem is, crashes the server and i think debug is a little bad, unless i am supposed to use print instead of sent to all anyways, here it is.

http://tenshi.pastebin.com/HtL14Fqc

or:

Код:
#include <a_samp>
#define FILTERSCRIPT

// Active Codes;
#define VMod	      true 		 // True = logging | false = do not logging
#define VSpray	      true 		 // True = logging | false = do not logging

// Debug + READ ME: By defult (while playing without testing) this must be False;

#define DBVMod	      true 		// True = Debug | false = do not debug
#define DBVSpray	    true 		// rue = Debug | false = do not debug

/* ```````````````````````````````````````````````````````````````````````````*/

public OnFilterScriptInit()
{
	print("\n--------------------------------------\nVLogger-Loaded\n--------------------------------------");
	return 1;
}

/* ```````````````````````````````````````````````````````````````````````````*/

stock Whois(playerid){ new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); return name; }

/* ```````````````````````````````````````````````````````````````````````````*/

public OnVehicleMod(playerid,vehicleid,componentid) //https://sampwiki.blast.hk/wiki/OnVehicleMod
{
	#if VMod
	new hour; new minute; new second; new day; new month; new year;
	getdate(year, month, day); gettime(hour,minute,second);
	new cmd[155];

	new File:VehicleMod;
	VehicleMod = fopen("logs/OnVehicleMod.txt",io_append);
	format(cmd,sizeof(cmd),"[%02d/%02d/%02d %02d:%02d:%02d] * %s in (VehicleID:%d) with (modID:%d) with (componentidID:%d) \r\n",day, month, year, hour, minute, second,Whois(playerid),vehicleid,componentid);
	fwrite(VehicleMod,cmd);	fclose(VehicleMod);	print(cmd);
  	#endif

	#if DBVMod
	new string[128];
  format(string, sizeof(string), "* [%02d/%02d/%02d %02d:%02d:%02d] * %s in (VehicleID:%d) with (modID:%d) with (componentidID:%d) \r\n",day, month, year, hour, minute, second,Whois(playerid),vehicleid,componentid);
  	SendClientMessageToAll(0xDEEE20FF, string);
	#endif

  return 1;
}

/* ```````````````````````````````````````````````````````````````````````````*/

public OnVehicleRespray(playerid, vehicleid, color1, color2) // https://sampwiki.blast.hk/wiki/OnVehicleRespray
{
	#if VSpray // #if
	new hour; new minute; new second; new day; new month; new year;
	getdate(year, month, day); gettime(hour,minute,second);
	new cmd[155];

	new File:VehicleSpray;
	VehicleSpray = fopen("logs/OnVehicleRespray.txt",io_append);
	format(cmd,sizeof(cmd),"[%02d/%02d/%02d %02d:%02d:%02d] * %s vehicle was sprayed, vehicle %d to colors %d and %d\r\n",day, month, year, hour, minute, second,Whois(playerid),vehicleid,color1,color2);
	fwrite(VehicleSpray,cmd);
	fclose(VehicleSpray);
	print(cmd);
  #endif
  
  #if DBVSpray
	new string[128];
  format(string, sizeof(string), "* [%02d/%02d/%02d %02d:%02d:%02d] * %s sprayed vehicle %d to colors %d and %d",Whois(playerid), vehicleid,color1,color2);
  	SendClientMessageToAll(0xDEEE20FF, string);
	#endif

	return 1;
}

/* ```````````````````````````````````````````````````````````````````````````*/
Reply
#2

I couldn't find what was wrong in your script, but i'm taking a guess that it has to do with io_append, take a quick second, and change io_append to io_write, just a thought if this would work or not. If it does than use fexist to make sure the file is created before you append it.
Reply
#3

Quote:
Originally Posted by Carlton
I couldn't find what was wrong in your script, but i'm taking a guess that it has to do with io_append, take a quick second, and change io_append to io_write, just a thought if this would work or not. If it does than use fexist to make sure the file is created before you append it.
i tried what you did, but still have the same problem and this:


get this weird text ^.

( as for the file it self... (searches) ... )

[26/03/2010 22:14:16] * [O.o]Tenshi vehicle was sprayed, vehicle 382 to colors 12 and 1

well it seem to have recorded 1 thing i did before server actually crashed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)