31.08.2018, 15:20
Код:
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; }