OnFilterScriptExit not being called? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnFilterScriptExit not being called? (
/showthread.php?tid=106504)
OnFilterScriptExit not being called? -
_Vortex - 03.11.2009
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;
}
Re: OnFilterScriptExit not being called? -
MadeMan - 03.11.2009
Put print("test"); as a first thing in there and try then.
Re: OnFilterScriptExit not being called? -
_Vortex - 03.11.2009
Quote:
Originally Posted by MadeMan
Put print("test"); as a first thing in there and try then.
|
Still didn't show in the logs.
Re: OnFilterScriptExit not being called? -
MadeMan - 03.11.2009
Can you show the code before and after that OnFilterScriptExit() ?
Re: OnFilterScriptExit not being called? -
Nero_3D - 03.11.2009
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)
Re: OnFilterScriptExit not being called? -
Andom - 03.11.2009
How is ''PropertiesAmount'' defined?
Re: OnFilterScriptExit not being called? -
_Vortex - 03.11.2009
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