HELP DINI to Y_INI
#1

Hi,

I have a problem for convert DINI to Y_INI

Code:
//dini
loadvehicle(playerid)
{
veh[playerid] = CreateVehicle(dini_Int(file, "Model"), dini_Float(file, "X"), dini_Float(file, "Y"), dini_Float(file, "Z"), dini_Float(file, "Angle"), dini_Int(file, "Color1"), dini_Int(file, "Color2"), 3600);
strmid(Vehicles[veh[playerid]][vOwner], dini_Get(file, "Owner"), 0, strlen(dini_Get(file, "Owner")), 255);
strmid(Vehicles[veh[playerid]][vInfo], dini_Get(file, "Info"), 0, strlen(dini_Get(file, "Info")), 255);
Vehicles[[veh[playerid]][vModel] = dini_Int(file, "Model");
Vehicles[[veh[playerid]][vX] = dini_Float(file, "X");
Vehicles[[veh[playerid]][vY] = dini_Float(file, "Y");
Vehicles[[veh[playerid]][vZ] = dini_Float(file, "Z");
...
}

//Y_INI
loadvehicle(playerid)
{
INI_ParseFile(file, "Load", .bExtra = true, .extra = playerid);
return 1;
}

Load(playerid,name[],value[])
{
new vx1;
	new Float:vx2;
        new Float:vx3;
	new Float:vx4;
	new Float:vx5;
	new vx6;
	new vx7;
	INI_Int("Model",vx1);
	INI_Float("X",vx2);
	INI_Float("Y",vx3);
	INI_Float("Z",vx4);
	INI_Float("Angle",vx5);
	INI_Int("Color1",vx6);
	INI_Int("Color2",vx7);
	veh[playerid] = CreateVehicle(vx1,vx2,vx3,vx4,vx5,vx6,vx7, 3600);
INI_String("Vehicle",Vehicles[veh[playerid]][vOwner],255);
INI_String("Info",Vehicles[veh[playerid]][vInfo],255);
INI_Int("Model",Vehicles[veh[playerid]][vModel]);
INI_Float("X",Vehicles[veh[playerid]][vX]);
...
}
The veh isn't created and I need to create this vehicle before to have veh[playerid] = id car and next INI_Int("Model",Vehicles[veh[playerid]][vModel]);...

Thanks
Reply
#2

EDIT.
Reply
#3

yea i would love to switch to yini but i have too much code to convert, someone needs to make a converter or something
Reply
#4

INI_ParseFile read only INI_ no? no the SenClientMessage?

I need to CreateVehicle with info in a file but this info need to be load by knowing the idcar...with DINI its possible but with Y_INI I don't know.

Otherwise to create a vehicle check the id, to destroy it, call INI_ParseFile with the ID car and create new car with info in the file
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)