13.04.2012, 09:55
(
Последний раз редактировалось park4bmx; 13.04.2012 в 10:56.
Причина: Problem SOlved
)
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
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
Also i chagne the INI_PerseFile to
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");
}
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
pawn Код:
INI_ParseFile(file, "LoadSettings", false, true, IDs, true, false );