forward SaveBusiness(id); public SaveBusiness(id) { new file4[40]; format(file4, sizeof(file4), BPATH, id); // #define BPATH "/Business/%i.ini" new INI:File = INI_Open(file4); INI_SetTag(File,"data");
forward loadbiz_data(idx, name[], value[]); public loadbiz_data(idx, name[], value[]) { INI_Int("bOwned", BusinessInfo[idx][bOwned]); bla bla bla.... return 1; }
stock SaveBizEx() { for(new idx = 1; idx < MAX_BIZ; idx++) { new var[32], INI:File = INI_Open("INIbiz.cfg"); // INI_SetTag(File, "Businesses"); // Is that necessary for one file? format(var, 32, "b%dOwner", idx); INI_WriteString(File, var, BizInfo[idx][bOwner]); format(var, 32, "b%dType", idx); INI_WriteInt(File, var, BizInfo[idx][bType]); format(var, 32, "b%dLocked", idx); INI_WriteInt(File, var, BizInfo[idx][bLocked]); format(var, 32, "b%dMoney", idx); INI_WriteInt(File, var, BizInfo[idx][bMoney]); format(var, 32, "b%dProducts", idx); INI_WriteInt(File, var, BizInfo[idx][bProducts]); format(var, 32, "b%dSold", idx); INI_WriteInt(File, var, BizInfo[idx][bSold]); format(var, 32, "b%dLevel", idx); INI_WriteInt(File, var, BizInfo[idx][bLevel]); format(var, 32, "b%dPrice", idx); INI_WriteInt(File, var, BizInfo[idx][bPrice]); format(var, 32, "b%dAP", idx); INI_WriteInt(File, var, BizInfo[idx][bAP]); format(var, 32, "b%dFee", idx); INI_WriteInt(File, var, BizInfo[idx][bFee]); format(var, 32, "b%dInt", idx); INI_WriteInt(File, var, BizInfo[idx][bInt]); format(var, 32, "b%dExtX", idx); INI_WriteFloat(File, var, BizInfo[idx][bExtX]); format(var, 32, "b%dExtY", idx); INI_WriteFloat(File, var, BizInfo[idx][bExtY]); format(var, 32, "b%dExtZ", idx); INI_WriteFloat(File, var, BizInfo[idx][bExtZ]); format(var, 32, "b%dExtFA", idx); INI_WriteFloat(File, var, BizInfo[idx][bExtFA]); format(var, 32, "b%dIntX", idx); INI_WriteFloat(File, var, BizInfo[idx][bIntX]); format(var, 32, "b%dIntY", idx); INI_WriteFloat(File, var, BizInfo[idx][bIntY]); format(var, 32, "b%dIntZ", idx); INI_WriteFloat(File, var, BizInfo[idx][bIntZ]); format(var, 32, "b%dIntFA", idx); INI_WriteFloat(File, var, BizInfo[idx][bIntFA]); INI_Close(File); return 1; } return 1; } |
forward LoadDynamic_Businesses(bizid,name[],value[]); public LoadDynamic_Businesses(bizid,name[],value[]) { new var[32]; format(var, 32, "b%dOwner", bizid); INI_String(var, BizInfo[bizid][bOwner], 32); format(var, 32, "b%dType", bizid); INI_Int(var, BizInfo[bizid][bType]); format(var, 32, "b%dLocked", bizid); INI_Int(var, BizInfo[bizid][bLocked]); format(var, 32, "b%dMoney", bizid); INI_Int(var, BizInfo[bizid][bMoney]); format(var, 32, "b%dProducts", bizid); INI_Int(var, BizInfo[bizid][bProducts]); format(var, 32, "b%dSold", bizid); INI_Int(var, BizInfo[bizid][bSold]); format(var, 32, "b%dLevel", bizid); INI_Int(var, BizInfo[bizid][bLevel]); format(var, 32, "b%dPrice", bizid); INI_Int(var, BizInfo[bizid][bPrice]); format(var, 32, "b%dAP", bizid); INI_Int(var, BizInfo[bizid][bAP]); format(var, 32, "b%dFee", bizid); INI_Int(var, BizInfo[bizid][bFee]); format(var, 32, "b%dInt", bizid); INI_Int(var, BizInfo[bizid][bInt]); format(var, 32, "b%dExtX", bizid); INI_Float(var, BizInfo[bizid][bExtX]); format(var, 32, "b%dExtY", bizid); INI_Float(var, BizInfo[bizid][bExtY]); format(var, 32, "b%dExtZ", bizid); INI_Float(var, BizInfo[bizid][bExtZ]); format(var, 32, "b%dExtFA", bizid); INI_Float(var, BizInfo[bizid][bExtFA]); format(var, 32, "b%dIntX", bizid); INI_Float(var, BizInfo[bizid][bIntX]); format(var, 32, "b%dIntY", bizid); INI_Float(var, BizInfo[bizid][bIntY]); format(var, 32, "b%dIntZ", bizid); INI_Float(var, BizInfo[bizid][bIntZ]); format(var, 32, "b%dIntFA", bizid); INI_Float(var, BizInfo[bizid][bIntFA]); return 1; } |