How to load infromation that written in .ini file
#1

How to load infromation that written in .ini file
Reply
#2

Try to "search" for Y_ini

Will help you out
Reply
#3

is this should work fine??

LoadTrunkFS()
{
new File:handle, count;
new filename[64], line[256];
for(new i=1; i < MAX_VEHICLES; i++)
{
format(filename, sizeof(filename), VEHICLE_FILE_PATH "v%d.ini", i);
if(!fexist(filename)) continue;
handle = fopen(filename, io_read);
while(fread(handle, line))
{
StripNL(line);
if(!line[0]) continue;
//if(strcmp(line, "Created=", false, == 0) VehicleCreated[i] = strval(line[8]);
//else if(strcmp(line, "Owner=", false, 6) == 0) strmid(VehicleOwner[i], line, 6, sizeof(line));
else if(strcmp(line, "Trunk1=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunkK[i][0][0], VehicleTrunkK[i][0][1]);
else if(strcmp(line, "Trunk2=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunkK[i][1][0], VehicleTrunkK[i][1][1]);
else if(strcmp(line, "Trunk3=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunkK[i][2][0], VehicleTrunkK[i][2][1]);
else if(strcmp(line, "Trunk4=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunkK[i][3][0], VehicleTrunkK[i][3][1]);
else if(strcmp(line, "Trunk5=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunkK[i][4][0], VehicleTrunkK[i][4][1]);
}
fclose(handle);
if(VehicleCreated[i]) count++;
}
printf(" Loaded %d vehicles", count);
}
Reply
#4

No idea, I am using d_ini

Altough I think Y_ini is better
Reply
#5

Any idea how to load inforamtion from INI file? usint anyy include??
Reply
#6

You've been told twice now. Dini or y_ini.
Reply
#7

But how usiny y_ini i dont know how to make it i cant figure out
Reply
#8

Its explained the Y_Ini page.

if u think its too complicated try dini, its a bit slower thou
Reply
#9

Dont you have it written and i will just change the location of the ini and information that i want i get from the ini
only that way i could know how it works ..
Reply
#10

That aint possible,
You will have to create an enum, define ur file, and then use the dini/y_ini ways,

Just search for tutorials or something, there are a lot of them and I guess some of them are really good and usefull.
If I would give you my script it wont help you in anything cause u will basicly need to redefine everything
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)