Loading File ?
#1

i done hell of alot of test , tring to load some data from files.
The files names are ID0,ID1,ID2
The problem is that the only files that gets loaded is the ID0 the rest dont want to load ?

Using Y_INI
pawn Код:
forward LoadSettings(IDs, name[], value[]);
public LoadSettings(IDs, name[], value[])
{
if(!strcmp(name, "PosX")) SetPVarFloat(IDs,"PosX", strval(value));
if(!strcmp(name, "PosY")) SetPVarFloat(IDs,"PosY", strval(value));
if(!strcmp(name, "PosZ")) SetPVarFloat(IDs,"PosZ", strval(value));
}

//Into some callback doesnt matter(it gets called, IDs are returned)
{
new file[80];
format(file,sizeof(file),"/ID%d.txt",IDs);
if(fexist(file))
       {
              INI_ParseFile(file, "LoadSettings", true, true, IDs, true, false);
              LoadX = GetPVarFloat(IDs, "PosX");
          LoadY = GetPVarFloat(IDs, "PosY");
          LoadZ = GetPVarFloat(IDs, "PosZ");
       }
Anyone know any solution ?

EDIT problem solved, some info for people that might have the same problem
what i done is i put the posX,Y,Z into enums
then i cahnge the perse to this
pawn Код:
if(!strcmp(name, "PosX", true)) { hInfo[IDs][PosX] = floatstr(value); }//i forgot that its a float :D
Also i chagne the INI_PerseFile to
pawn Код:
INI_ParseFile(file, "LoadSettings", false, true, IDs, true, false );
Reply
#2

Are you sure the callback calls all the 3 different ids? Also, try this:
pawn Код:
printf("ID: %d", IDs);
in the callback and see if the ID's are actually being called.
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Are you sure the callback calls all the 3 different ids? Also, try this:
pawn Код:
printf("ID: %d", IDs);
in the callback and see if the ID's are actually being called.
like i said yes i done multiple testing the ID's are looped currectly
pawn Код:
Loop(IDs,MAX_IDS)//for(new %0 = 0; %0 < %1; %0++)
Reply
#4

Problem Solved
added info how i solved it if anyone has the same prob.
Tnx "Killer" for trying to help out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)