Y.INI Reversed Saving (+REP)
#1

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);
Reply
#2

Please, anyone...
Reply
#3

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

Isti kurac brate bitno da radi
Reply
#4

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...
Reply
#5

Lock, its up to YSI 4.0.1 @Y-Less
Reply
#6

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

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)