Problem with deleting file
#1

Код:
YCMD:deletebusiness(playerid, params[], help)
{
	#pragma unused help
	new id;
	if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0xC0C0C0FF, "USAGE: /deletebusiness [id]");
	
	new ffile[40];
	format(ffile, sizeof(ffile), BUSINESS_PATH, id);
	
        if(!fexist(ffile)) return SendClientMessage(playerid, 0xC0C0C0FF, "That business doesn't exist.");

	DestroyDynamicPickup(BusinessInfo[id][EnterancePickup]);
	Delete3DTextLabel(BusinessInfo[id][Label]);

	fremove(ffile);
	
	new str1[40];
	for(new h = 1; h < sizeof(BusinessInfo); h++)
	{
		format(str1, sizeof(str1), BUSINESS_PATH, h);
		INI_ParseFile(str1, "LoadBusinesses_%s", .bExtra = true, .extra = h );
	}
	
	for(new j = 1; j < sizeof(BusinessInfo); j++)
	{
		if(BusinessInfo[j][Price] == 0) break;
		SaveBusiness(j);
	}
	
	new msg[128];
	format(msg,sizeof(msg),"You've successfully deleted Business (ID: %i)!",id);
	SendClientMessage(playerid,0xFCC937FF,msg);
	return 1;
}
It deletes pickup and label but it do not delete ini file what's a problem? i am struggling with it more then 1 hour!!!
Reply
#2

Anyone? XD
Reply
#3

Quote:

No Double Posting - There is a modify button , use it. However, bumping a topic in which you have or require further information is allowed after at least 24 hours.

Don't bump your topic in 10 minutes after posting your topic, just be patient and wait for a response from someone.
Reply
#4

How are you defining BUSINESS_PATH ?
Reply
#5

Yes i did
#define BUSINESS_PATH "/Businesses/%i.ini"
Reply
#6

You must fclose before fremove
Reply
#7

But i do not open it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)