20.04.2014, 13:12
First You need to define the place you want to save
the
Sorry didn't saw the upper post well i think he got better way
the
Код:
#define OwnerPath "Business/Owners/%s.ini" /*Will define owner path*/
Код:
stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path { new str[128],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); for(new d,len = strlen(name); d != len; d++) name[d] = tolower(name[d]); format(str,sizeof(str),OwnerPath,name); return str; }
Код:
new INI:file = INI_Open(Path(playerid)); INI_SetTag(file,"Business_Owner_Data"); //this will be tag on the file which will save the data INI_WriteInt(file,"Goods",BusinessInfo[shopid][bGoods]); INI_Close(file);//Now after we've done saving their data, we now need to close the file