SA-MP Forums Archive
Y.INI Reversed Saving (+REP) - 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: Y.INI Reversed Saving (+REP) (/showthread.php?tid=648067)



Y.INI Reversed Saving (+REP) - maksicnm - 15.01.2018

So YSI is saving reversed...
It shouldn't be like this, it should be like "Lozinka" on top, "Level" after "Lozinka"...
HTML Code:
[data]
AKod = 971
Skin = 26
Smrti = 0
Ubistva = 0
Spawn = 1
Garaza = 0
Biznis = 0
Stan = 0
Kuca = 0
DME = 0
Beta = 0
VIP = 0
GameXpert = 0
Mail = 
Drzava = 1
Godine = 22
Pol = 1
Maper = 0
Skripter = 0
Vlasnik = 0
Admin = 7
Novac = 35000
Level = 2
Lozinka = 228131566
So here is the SavePlayer:
HTML Code:
stock SavePlayer(playerid)
{
	if(UProvera[playerid] == 1)
	{
		new INI:File = INI_Open(Korisnici(playerid));
		INI_SetTag(File,"data");
		INI_WriteInt(File,"Level",PI[playerid][pLevel]);
		INI_WriteInt(File,"Novac",PI[playerid][pMoney]);
		INI_WriteInt(File,"Admin",PI[playerid][pAdmin]);
		INI_WriteInt(File,"Vlasnik",PI[playerid][pVlasnik]);
		INI_WriteInt(File,"Skripter",PI[playerid][pSkripter]);
		INI_WriteInt(File,"Maper",PI[playerid][pMaper]);
		INI_WriteInt(File,"Pol",PI[playerid][pSex]);
		INI_WriteInt(File,"Godine",PI[playerid][pYear]);
		INI_WriteInt(File,"Drzava",PI[playerid][pState]);
		INI_WriteString(File,"Mail",PI[playerid][pMail]);
		INI_WriteInt(File,"GameXpert",PI[playerid][pGX]);
		INI_WriteInt(File,"VIP",PI[playerid][pVip]);
		INI_WriteInt(File,"Beta",PI[playerid][pBT]);
		INI_WriteInt(File,"DME",PI[playerid][pDME]);
		INI_WriteInt(File,"Kuca",PI[playerid][pKuca]);
		INI_WriteInt(File,"Stan",PI[playerid][pStan]);
		INI_WriteInt(File,"Biznis",PI[playerid][pBiz]);
		INI_WriteInt(File,"Garaza",PI[playerid][pGaraza]);
		INI_WriteInt(File,"Spawn",PI[playerid][pSpawn]);
		INI_WriteInt(File,"Ubistva",PI[playerid][pUbistva]);
		INI_WriteInt(File,"Smrti",PI[playerid][pSmrti]);
		INI_WriteInt(File,"Skin",PI[playerid][pSkin]);
		INI_WriteInt(File,"AKod",PI[playerid][pKod]);
		INI_Close(File);
	}
	return 1;
}
Here is creating of .ini
HTML Code:
INI_SetTag(File,"data");
			INI_WriteInt(File,"Lozinka",udb_hash(inputtext));
			INI_WriteInt(File,"Level",0);
			INI_WriteInt(File,"Novac",0);
			INI_WriteInt(File,"Admin",0);
			INI_WriteInt(File,"Vlasnik",0);
			INI_WriteInt(File,"Skripter",0);
			INI_WriteInt(File,"Maper",0);
			INI_WriteInt(File,"Pol",0);
			INI_WriteInt(File,"Godine",0);
			INI_WriteInt(File,"Drzava",0);
			INI_WriteInt(File,"Mail",0);
			INI_WriteInt(File,"GameXpert",0);
			INI_WriteInt(File,"VIP",0);
			INI_WriteInt(File,"Beta",0);
			INI_WriteInt(File,"DME",0);
			INI_WriteInt(File,"Kuca",0);
			INI_WriteInt(File,"Stan",0);
			INI_WriteInt(File,"Biznis",0);
			INI_WriteInt(File,"Garaza",0);
			INI_WriteInt(File,"Spawn",0);
			INI_WriteInt(File,"Ubistva",0);
			INI_WriteInt(File,"Smrti",0);
			INI_WriteInt(File,"Skin",-1);
			INI_WriteInt(File,"AKod",-1);
			INI_Close(File);



Re: Y.INI Reversed Saving (+REP) - maksicnm - 15.01.2018

Please, anyone...


Re: Y.INI Reversed Saving (+REP) - andrejc999 - 15.01.2018

What's the point? It's the same thing. The most important thing is that it works...

Isti kurac brate bitno da radi


Re: Y.INI Reversed Saving (+REP) - maksicnm - 15.01.2018

Quote:
Originally Posted by andrejc999
View Post
What's the point? It's the same thing. The most important thing is that it works...

Isti kurac brate bitno da radi ��
Ok. (STILL HELP WANTED)

@OL Pa brate bitno mi je, nije mi uredno ovako, a i lakse mi je, isti nacin kreiranja kao na UP modu a ne kreira isto, wtf...


Re: Y.INI Reversed Saving (+REP) - maksicnm - 15.01.2018

Lock, its up to YSI 4.0.1 @Y-Less


Re: Y.INI Reversed Saving (+REP) - RogueDrifter - 15.01.2018

What's the problem? the order doesn't matter one bit.


Re: Y.INI Reversed Saving (+REP) - SlowARG - 15.01.2018

I think I remember that's caused by SetTag, remove that line.


Re: Y.INI Reversed Saving (+REP) - Adain - 15.01.2018

He can't remove SetTag. Because SetTag is need for Load_User_%s (where %s is SetTag).


Re: Y.INI Reversed Saving (+REP) - Misiur - 15.01.2018

You can remove tag if you only have one per file anyway, but then you have to set the callback parameter to "Load_User", not "Load_User_%s" (and have Load_User public function). As for order - it really does not matter. In most languages, ini files are loaded at once into an array (or a map, or equivalent in your target lang). Even in php, the parse_ini_file function returns an array. And if you have ini file big enough to read it via streaming, then you do something wrong. If you have an example other than "I print ini contents in my admin panel and I want it ordered the way I like", leave me a message.