SA-MP Forums Archive
Tag mismatch - Y_INI - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tag mismatch - Y_INI (/showthread.php?tid=503473)



Tag mismatch - Y_INI - Lidor124 - 29.03.2014

Tag mismatch on words with " " and inside with %d, so how to make it without tag mismatch but keep the loop?
Give me one exmaple of one line and i will make them all the same.
+REP

Код:
for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
	{
		INI_WriteInt(File,"pv%dPosX", v, PlayerVehicleInfo[playerid][v][pvPosX]);
		INI_WriteInt(File,"pv%dPosY", v, PlayerVehicleInfo[playerid][v][pvPosY]);
		INI_WriteInt(File,"pv%dPosZ", v, PlayerVehicleInfo[playerid][v][pvPosZ]);
		INI_WriteInt(File,"pv%dPosAngle", v, PlayerVehicleInfo[playerid][v][pvPosAngle]);
		INI_WriteInt(File,"pv%dModelId", v, PlayerVehicleInfo[playerid][v][pvModelId]);
		INI_WriteInt(File,"pv%dLock", v, PlayerVehicleInfo[playerid][v][pvLock]);
		INI_WriteInt(File,"pv%dLocked", v, PlayerVehicleInfo[playerid][v][pvLocked]);
		INI_WriteInt(File,"pv%dPaintJob", v, PlayerVehicleInfo[playerid][v][pvPaintJob]);
		INI_WriteInt(File,"pv%dColor1", v, PlayerVehicleInfo[playerid][v][pvColor1]);
		INI_WriteInt(File,"pv%dColor2", v, PlayerVehicleInfo[playerid][v][pvColor2]);
		INI_WriteInt(File,"pv%dPrice", v, PlayerVehicleInfo[playerid][v][pvPrice]);
		INI_WriteInt(File,"pv%dTicket", v, PlayerVehicleInfo[playerid][v][pvTicket]);
		INI_WriteInt(File,"pv%dWeapon0", v, PlayerVehicleInfo[playerid][v][pvWeapons][0]);
		INI_WriteInt(File,"pv%dWeapon1", v, PlayerVehicleInfo[playerid][v][pvWeapons][1]);
		INI_WriteInt(File,"pv%dWeapon2", v, PlayerVehicleInfo[playerid][v][pvWeapons][2]);
		INI_WriteInt(File,"pv%dWepUpgrade", v, PlayerVehicleInfo[playerid][v][pvWepUpgrade]);
		if(PlayerVehicleInfo[playerid][v][pvImpounded] == 0) PlayerVehicleInfo[playerid][v][pvFuel] = VehicleFuel[PlayerVehicleInfo[playerid][v][pvId]];
		INI_WriteInt(File,"pv%dFuel", v, PlayerVehicleInfo[playerid][v][pvFuel]);
		INI_WriteInt(File,"pv%dCarHealth", v, PlayerVehicleInfo[playerid][v][pvCarHealth]);
		INI_WriteInt(File,"pv%dImpound", v, PlayerVehicleInfo[playerid][v][pvImpounded]);
		INI_WriteInt(File,"pv%dNumPlate", v, PlayerVehicleInfo[playerid][v][pvNumberPlate]);
		for(new m = 0; m < MAX_MODS; m++)
		{
			INI_WriteInt(File,"pv%dMod%d", v, m, PlayerVehicleInfo[playerid][v][pvMods][m]);
		}
	}



Re: Tag mismatch - Y_INI - Konstantinos - 29.03.2014

The problem is that you used INI_WriteInt for writing floats. It should be INI_WriteFloat.

By the way, there's another problem. Use format for "pv%d..." and then use:
pawn Код:
INI_Write/* Int/Float */(File, /* name - the one you'll format */, PlayerVehicleInfo[playerid][v][/* enum index */]);



Re: Tag mismatch - Y_INI - Lidor124 - 29.03.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The problem is that you used INI_WriteInt for writing floats. It should be INI_WriteFloat.

By the way, there's another problem. Use format for "pv%d..." and then use:
pawn Код:
INI_Write/* Int/Float */(File, /* name - the one you'll format */, PlayerVehicleInfo[playerid][v][/* enum index */]);
Thanks Konstantinos +REP
Note: I'm new to Y_INI, its my first time i'm using it so becasue of that all my mistakes :P

EDIT: "You must spread some reputation around before giving it to Konstantinos again"