Dini2 problem - 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: Dini2 problem (
/showthread.php?tid=664473)
Dini2 problem -
andrejc999 - 01.03.2019
So here is my user save system:
Код:
stock SavePlayer(playerid)
{
new file[64];
format(file, sizeof(file), "/Users/%s.ini", pInfo[playerid][pIme]);
if(pInfo[playerid][pLogged] == 1 && ocitan[playerid] == 1)
{
if(dini_Exists(file))
{
dini_IntSet(file, "Kills", pInfo[playerid][pKills]);
.
.
.
dini_IntSet(file, "Skin", pInfo[playerid][pSkin]);
//These lines don't get saved, Dini doesn't add them to the .ini file for some reason
dini_IntSet(file, "Pol", pInfo[playerid][pPol]);
dini_IntSet(file, "Drzava", pInfo[playerid][pDrzava]);
dini_IntSet(file, "Godine", pInfo[playerid][pGodine]);
dini_IntSet(file, "Registrovan", pInfo[playerid][pRegistrovan]);
}
}
And only the last 4 variables don't get saved for some reason.
Any idea why?
I'm using Dini2 btw, it's a faster version of Dini.
EDIT:
Sorry for posting I solved it like 10 sec after I posted this.
The problem was that Dini2 reads/saves maximum of 64 lines per file by default. Just had to crank it up
Re: Dini2 problem -
SymonClash - 01.03.2019
Glad you solved. But i suggest you to switch to MySQL or if you're a newbie to this language (not insulting you, tbh), SQLiteI. (
https://sampforum.blast.hk/showthread.php?tid=303682)
Dini is so 2006.
Re: Dini2 problem -
andrejc999 - 01.03.2019
The thing is, I used to love the simplicity of Dini and after Dini2 was released I switched to it because it's fast af like compared to y_ini it's 10 times faster. So I guess I'll stick with it because I don't need anything better.
Anyway thanks for your suggestion. I took a look at SQLite and tbh I can't be bothered to learn it because I'm close to finishing my server and it has a lot of Dini loading/saving in it (works amazing btw) so maybe I'll switch to it in the future.
Re: Dini2 problem -
Infin1ty - 02.03.2019
No. You should genuinely switch to any type of SQL (whether its MySQL, PostgreSQL or SQLite) as soon as possible. Who said SQL wasn't simple? Besides, after some time, the more you add to ini files the more time it takes to load.