OnFilterScriptExit not being called?
#1

Hey, I'm using a property system, and it doesn't seem to be calling OnFliterScriptExit, which is making it not able to save bought property, which is a problem.

I know it's not being called because there's a "printf" on it, and it's not showing up in the logs.

Here's the OnFilterScriptExit callback, if you need anymore info/code, ask me.

Код:
public OnFilterScriptExit()
{
	new entry[256];
	new File: propfile = fopen("PropertySystem/PropertyInfo.txt", io_write);
	for(new id; id<PropertiesAmount; id++)
	{
	  format(entry, 128, "%s,%.2f,%.2f,%.2f,%d,%d,%s,%d,%d \r\n",PropInfo[id][PropName], PropInfo[id][PropX], PropInfo[id][PropY], PropInfo[id][PropZ], PropInfo[id][PropValue], PropInfo[id][PropEarning], PropInfo[id][PropOwner], PropInfo[id][PropIsBought], PropInfo[id][PropUnbuyableTime]);
		fwrite(propfile, entry);
	}
	printf("Saved %d Properties!", PropertiesAmount);
	fclose(propfile);
	return 1;
}
Reply
#2

Put print("test"); as a first thing in there and try then.
Reply
#3

Quote:
Originally Posted by MadeMan
Put print("test"); as a first thing in there and try then.
Still didn't show in the logs.
Reply
#4

Can you show the code before and after that OnFilterScriptExit() ?
Reply
#5

OnFilterScriptExit is only called if you unload the fs or exit the server window with the command exit (closing the window doesnt do this effect)
Reply
#6

How is ''PropertiesAmount'' defined?
Reply
#7

Quote:
Originally Posted by ♣ ⓐⓢⓢ
OnFilterScriptExit is only called if you unload the fs or exit the server window with the command exit (closing the window doesnt do this effect)
Fuck, so how am I suppose to save my properties D:

Figured it out, thanks for informing me that it doesn't work when you just close it :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)