19.09.2014, 12:22
Hello again, Can anyone tell me how can i write the Business IDs in 2 separate lines? I mean there should be something like this in the file
I tried this code
But with this, it will store the player's first business id and if they buy another, its replacing the first business id with the second one, not creating a new line for the second business id. The same code worked fine with the default file saving system but with y_ini, its not working. I searched around the whole forums + ******, but couldn't find anything related to this.
Код:
Jailed = 1 Muted = false RulesRead = true Business = 45 Business = 68
pawn Код:
pData_Save(playerid)
{
new
INI:File = INI_Open(User_Directory(playerid));
INI_SetTag(File, "db");
INI_WriteInt(File, "MoneyBoost", pInfo[playerid][MoneyBoost]);
INI_WriteInt(File, "BoostTime", pInfo[playerid][BoostTime]);
INI_WriteInt(File, "Jailed", pInfo[playerid][Jailed]);
INI_WriteBool(File, "Muted", pInfo[playerid][Muted]);
INI_WriteBool(File, "RulesRead", pInfo[playerid][RulesRead]);
for(new i; i < MAX_BUSINESSPERPLAYER; i++)
{
if(pInfo[playerid][Business][i] != 0)
{
INI_WriteInt(File, "Business", pInfo[playerid][Business][i]);
}
}
INI_Close(File);
return 1;
}