[Player Data] pPass = 51628CEBAA4B4CF20721C377531D444F2CD285CA7D9606AE607098C2575DF01C2438DACA992D2A9F31FE5D258C0F5622A96BDF360436EF118ACBF0B3CF484414 ... pPhonebook = 0 [Player Position] pLastX = 151.069824 pLastY = -206.372817 pLastZ = 3.302008 [Player Vehicles] pVehicleID = 0 ... pVehiclePrice = 0 [Player Bank] pBankBalance = 0 pPendingDeposit = 0
[Player Data] pPass = 51628CEBAA4B4CF20721C377531D444F2CD285CA7D9606AE607098C2575DF01C2438DACA992D2A9F31FE5D258C0F5622A96BDF360436EF118ACBF0B3CF484414 ... pPhonebook = 0 [Player Position] pLastX = 151.069824 pLastY = -206.372817 pLastZ = 3.302008 [Player Vehicles] pVehicleID = 0 ... pVehiclePrice = 0 [Player Bank] pBankBalance = 0 pPendingDeposit = 0
If you had two modes (or even just two libraries) in dini, any user system would need to use separate files for each one. Wheras here the different modes' data are separated by tags (the bits in square brackets). This is where the odd syntax in the read function came in. |
// first tag & input
INI_SetTag(ini, "Account Info");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", gScore);
// second tag & input
INI_SetTag(ini, "House Info");
INI_WriteInt(ini, "House Owner", pInfo[playerid][HouseOwner]);
INI_WriteInt(ini, "House Keys", pInfo[playerid][HouseKeys]);
// third tag & input
INI_SetTag(ini, "Vehicle Info");
INI_WriteInt(ini, "Vehicle Owner", pInfo[playerid][VehicleOwner]);
INI_WriteInt(ini, "Vehicle Keys", pInfo[playerid][VehicleKeys]);
//etc
public OnGameModeInit()
{
new
INI:ini = INI_Open("myini.ini");
INI_SetTag(ini, "LVDM");
INI_WriteString(ini, "NAME", "******");
INI_SetTag(ini, "PD");
INI_WriteString(ini, "GENDER", "Male");
INI_Close(ini);
return 1;
}
[LVDM] NAME = ****** [PD] GENDER = Male
format(val, sizeof(val), "%d \n", PlayerInfo[playerid][variable]);
INI_WriteINT(ini, "Variable", val);
-_- Look at the pictures, then re-read the thread title. Rewriting the thread description for misleading you guys, sorry.
|
Originally Posted by Aerotactics
I'm trying to make my user files easier to read, so by using settag, is it possible to add a space before the settag?
|
public OnGameModeInit()
{
new
INI:ini = INI_Open("myini.ini");
INI_SetTag(ini, "LVDM");
INI_WriteString(ini, "NAME", "******");
INI_SetTag(ini, "\r\nPD");
INI_WriteString(ini, "GENDER", "Male");
INI_Close(ini);
return 1;
}
[LVDM] NAME = ****** [ PD] GENDER = Male
Actually, you can, but it ends up messing up the tags :P. I assume you'll have to edit y_ini's way of defining tags which isn't really recommended.
This: pawn Код:
Код:
[LVDM] NAME = ****** [ PD] GENDER = Male |
[User] <-- actual tag Name = Test [Position] <-- not a tag, manual string x = 1.1 Y = 2.2 Z = 2.2
He does not want multiple tags, that is what he is trying to say, how ever he did not word his request properly.
He wants this: Код:
[User] <-- actual tag Name = Test [Position] <-- not a tag, manual string x = 1.1 Y = 2.2 Z = 2.2 |