INI_String
#7

You'd normally have to read those sorts of thing somewhere else an assign them when using something like Y_INI, as the syntax, as said before, is:

Код:
INI_String(name[], dest[], size)
In most cases, you'd do a file parse with Y_INI, resulting in something like this for vehicles....

Код:
stock vLoad(vehID, file[])
{
	INI_ParseFile(file,"LoadVehicleData", .bExtra = true, .extra = vehID);
	CreateOwnedVeh(vData[vehID][vModel],vData[vehID][vPos][0],vData[vehID][vPos][1],vData[vehID][vPos][2],vData[vehID][vPos][3],vData[vehID][vCol1],vData[vehID][vCol2],vData[vehID][vOwner]);
}

forward LoadVehicleData(vehID, name[], value[]);
public LoadVehicleData(vehID, name[], value[])
{
	INI_Int("Model",vData[vehID][vModel]);
	for(new i = 0; i < 4; i++) {
		format(strLoc,sizeof(strLoc),"Pos%d",i);
		INI_Float(strLoc,vData[vehID][vPos][i]); }
	INI_Int("Color1",vData[vehID][vCol1]);
	INI_Int("Color2",vData[vehID][vCol2]);
	INI_String("Owner",vData[vehID][vOwner],24);
 	INI_Int("Lockstate", vData[vehID][vLocked]);
	return 1;
}
That assigns the ini file's contents to variables, then you can use strcmp to compare those variables safely.

This is, however, assuming that you are using Y_INI.

I couldn't even remotely help you with dini, except from offering the advice of attempting to move to YINI, but it should be somewhat similar, lol.
Reply


Messages In This Thread
INI_String - by EmpireSk - 07.03.2015, 21:59
Re: INI_String - by Fantje - 07.03.2015, 22:20
Respuesta: Re: INI_String - by JuanStone - 08.03.2015, 01:22
AW: INI_String - by BiosMarcel - 08.03.2015, 01:45
Re: INI_String - by EmpireSk - 08.03.2015, 07:46
Re: INI_String - by EmpireSk - 08.03.2015, 17:00
Re: INI_String - by Zonoya - 08.03.2015, 17:05
Re: INI_String - by EmpireSk - 09.03.2015, 19:33

Forum Jump:


Users browsing this thread: 2 Guest(s)