yini load won't work. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: yini load won't work. (
/showthread.php?tid=618502)
yini load won't work. -
qUneT - 06.10.2016
Hi, i created a YINI basic personal car system. The strange thing is... the system don't load the info, but it saves It, i tested it.
Код:
forward loadcar_data(idx, name[], value[]);
public loadcar_data(idx, name[], value[])
{
INI_Int("cModel", CarsInfo[idx][cModel]);
INI_Float("cSpawnX", CarsInfo[idx][cSpawnX]);
INI_Float("cSpawnY", CarsInfo[idx][cSpawnY]);
INI_Float("cSpawnZ", CarsInfo[idx][cSpawnZ]);
INI_Float("cSpawnA", CarsInfo[idx][cSpawnA]);
INI_Int("cColor1", CarsInfo[idx][cColor1]);
INI_Int("cColor2", CarsInfo[idx][cColor2]);
INI_Int("cLocked", CarsInfo[idx][cLocked]);
INI_Int("cID", CarsInfo[idx][cID]);
INI_String("cOwner", CarsInfo[idx][cOwner],128);
return 1;
}
Under OnGameModeInit
Код:
new str1[40];
for(new idx = 1; idx < sizeof(CarsInfo); idx++)
{
new str12[254];
format(str12, sizeof(str12), CPATH, idx);
INI_ParseFile(str1, "loadcar_%s", .bExtra = true, .extra = idx );
OwnedCarID[idx] = AddStaticVehicle(CarsInfo[idx][cModel], CarsInfo[idx][cSpawnX], CarsInfo[idx][cSpawnY], CarsInfo[idx][cSpawnZ], CarsInfo[idx][cSpawnA], CarsInfo[idx][cColor1], CarsInfo[idx][cColor2]);
print("Masina Incarcata!"); --------------------- this line works when the server starts
}
What's the problem?
Re: yini load won't work. -
qUneT - 06.10.2016
Done.
format(str12, sizeof(str12), CPATH, idx);
INI_ParseFile(str1, "loadcar_%s", .bExtra = true, .extra = idx );
INI_ParseFile(str1 ----> INI_ParseFile(str12