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


Messages In This Thread
Problem with deleting file [NOT SOLVED]!!!!! - by ShadowCoder - 31.08.2018, 15:20
Re: Problem with deleting file - by ShadowCoder - 31.08.2018, 15:38
Re: Problem with deleting file - by solstice_ - 31.08.2018, 15:41
Re: Problem with deleting file - by Shinja - 31.08.2018, 15:59
Re: Problem with deleting file - by ShadowCoder - 31.08.2018, 22:24
Re: Problem with deleting file - by Shinja - 31.08.2018, 22:29
Re: Problem with deleting file - by ShadowCoder - 31.08.2018, 22:40

Forum Jump:


Users browsing this thread: 1 Guest(s)