Remove junk - 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: Remove junk (
/showthread.php?tid=572951)
Remove junk -
Shazwan - 03.05.2015
Hello can anyone help me why does this fremove didn't work? I'm trying to delete this while in game. Name of the file that need to be delete is "djson-db-cache.0" for example. The type of this file is "DB File".
Код:
CMD:clearcache(playerid, params[])
{
fremove("djson-db-cache.0");
fremove("djson-db-cache.1");
fremove("djson-db-cache.2");
fremove("djson-db-cache.3");
fremove("djson-db-cache.4");
fremove("djson-db-cache.5");
fremove("djson-db-cache.6");
SendClientMessageEx(playerid, COLOR_TWRED, "Server: Junk Cleaned!");
return 1;
}
Re: Remove junk -
Sledgehammer - 03.05.2015
Are the files located in scriptfiles?
Re: Remove junk -
Shazwan - 03.05.2015
Yes the cache is located in the scriptfile
this image
Re: Remove junk -
kristo - 03.05.2015
These files have a .db extension.
pawn Код:
CMD:clearcache(playerid, params[])
{
fremove("djson-db-cache.0.db");
fremove("djson-db-cache.1.db");
fremove("djson-db-cache.2.db");
fremove("djson-db-cache.3.db");
fremove("djson-db-cache.4.db");
fremove("djson-db-cache.5.db");
fremove("djson-db-cache.6.db");
SendClientMessageEx(playerid, COLOR_TWRED, "Server: Junk Cleaned!");
return 1;
}
or...
pawn Код:
CMD:clearcache(playerid, params[])
{
new temp[20];
for (new i; i <= 6; i++)
{
format(temp, sizeof(temp), "djson-db-cache.%i.db", i);
fremove(temp);
}
SendClientMessageEx(playerid, COLOR_TWRED, "Server: Junk Cleaned!");
return 1;
}
Re: Remove junk -
Shazwan - 03.05.2015
It works thanks rep+