Remove junk
#1

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;
}
Reply
#2

Are the files located in scriptfiles?
Reply
#3

Yes the cache is located in the scriptfile

this image
Reply
#4

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;
}
Reply
#5

It works thanks rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)