Dini to Y_ini, public Load() - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dini to Y_ini, public Load() (
/showthread.php?tid=214930)
Dini to Y_ini, public Load() -
Daddy Yankee - 22.01.2011
I have a problem.. I want to use this because dini makes my server lag alot. I'm using it for a car system, the thing is, when I edit the files with Y_ini it makes it Model = 522 instead of Model=522. After this the cars are not loading, maybe because I just don't get it how to convert LoadCar to Y_ini. Maybe the problem is another, in any case I need your help in this.
There's my code, thanks in advance
Код:
public LoadCar()
{
new file[26];
for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
{
format(file, sizeof(file),"Cars/%d.ini", idx);
if(dini_Exists(file))
{
CarInfo[idx][tModel] = dini_Int(file,"Model");
CarInfo[idx][tLocationx] = dini_Float(file,"Locationx");
CarInfo[idx][tLocationy] = dini_Float(file,"Locationy");
CarInfo[idx][tLocationz] = dini_Float(file,"Locationz");
CarInfo[idx][tAngle] = dini_Float(file,"Angle");
CarInfo[idx][tColorOne] = dini_Int(file,"ColorOne");
CarInfo[idx][tColorTwo] = dini_Int(file,"ColorTwo");
strmid(CarInfo[idx][tOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
CarInfo[idx][tOwned] = dini_Int(file,"Owned");
CarInfo[idx][tLock] = dini_Int(file,"Lock");
CarInfo[idx][tPaintjob] = dini_Int(file,"Paintjob");
CarInfo[idx][tOwnable] = dini_Int(file,"Ownable");
CarInfo[idx][tFaction] = dini_Int(file,"Faction");
CarInfo[idx][tAlarm] = dini_Int(file,"Alarm");
CarInfo[idx][tInsured] = dini_Int(file,"Insured");
CarInfo[idx][tPrice] = dini_Int(file,"Price");
CarInfo[idx][tLicensePlate] = dini_Int(file,"LicensePlate");
}
}
print("[SCRIPT]: Loaded Cars");
return 1;
}
Re: Dini to Y_ini, public Load() -
Daddy Yankee - 22.01.2011
Anyone ?
Re: Dini to Y_ini, public Load() -
Daddy Yankee - 23.01.2011
Relly now, can someone give me an example how to turn this into Y_ini ? Because I can't read the files changed by Y_ini because is writing a space before and after "=".