Tag mismatch - Y_INI
#1

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]);
		}
	}
Reply
#2

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 */]);
Reply
#3

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"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)