SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/01/2018, 07:41 AM   #1
maksicnm
Big Clucker
 
Join Date: Sep 2016
Location: Serbia
Posts: 120
Reputation: 3
Default Y.INI Reversed Saving (+REP)

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);
maksicnm is offline   Reply With Quote
Old 15/01/2018, 08:10 AM   #2
maksicnm
Big Clucker
 
Join Date: Sep 2016
Location: Serbia
Posts: 120
Reputation: 3
Default Re: Y.INI Reversed Saving (+REP)

Please, anyone...
maksicnm is offline   Reply With Quote
Old 15/01/2018, 08:12 AM   #3
andrejc999
Huge Clucker
 
Join Date: Jun 2014
Posts: 228
Reputation: 6
Default Re: Y.INI Reversed Saving (+REP)

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

Isti kurac brate bitno da radi ��
andrejc999 is offline   Reply With Quote
Old 15/01/2018, 08:27 AM   #4
maksicnm
Big Clucker
 
Join Date: Sep 2016
Location: Serbia
Posts: 120
Reputation: 3
Default Re: Y.INI Reversed Saving (+REP)

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...
maksicnm is offline   Reply With Quote
Old 15/01/2018, 08:44 AM   #5
maksicnm
Big Clucker
 
Join Date: Sep 2016
Location: Serbia
Posts: 120
Reputation: 3
Default Re: Y.INI Reversed Saving (+REP)

Lock, its up to YSI 4.0.1 @Y-Less
maksicnm is offline   Reply With Quote
Old 15/01/2018, 09:22 AM   #6
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,192
Reputation: 420
Default Re: Y.INI Reversed Saving (+REP)

What's the problem? the order doesn't matter one bit.
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 15/01/2018, 09:53 AM   #7
SlowARG
Little Clucker
 
Join Date: Feb 2014
Posts: 38
Reputation: 18
Default Re: Y.INI Reversed Saving (+REP)

I think I remember that's caused by SetTag, remove that line.
__________________
My releases:

[GitLab] [Plugin] Nobody's fork of YSF
[GitLab] [FilterScript] SA-MP S.S.F.P.
SlowARG is offline   Reply With Quote
Old 15/01/2018, 10:01 AM   #8
Adain
Little Clucker
 
Adain's Avatar
 
Join Date: May 2017
Location: On the cloud nine
Posts: 28
Reputation: 1
Default Re: Y.INI Reversed Saving (+REP)

He can't remove SetTag. Because SetTag is need for Load_User_%s (where %s is SetTag).
Adain is offline   Reply With Quote
Old 15/01/2018, 10:14 AM   #9
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 556
Default Re: Y.INI Reversed Saving (+REP)

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.
Misiur is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A number double the size when reversed. Mrkrabz Everything and Nothing 19 29/08/2012 03:18 PM
Reversed License Plate on some vehicles Joe Staff Bug Reports 15 25/01/2011 06:26 PM
Controls are reversed after 5-10 min's of playing Cyrix404 Client Support 1 05/03/2010 03:39 PM
Good Dini/Dudb tutorial for file saving and info saving for example score ect JoeDaDude Help Archive 2 07/02/2010 09:04 PM


All times are GMT. The time now is 07:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.