[DINI] Won't save
#1

Hello,

I'm making a new server with DINI but i can't find a way to save it
properly from enum. Nothing is saving, i copied the one how i made
the skin save system with dini and pasted here to show so you can
say what's wrong with it. Script:
Код:
enum pInfo
{
 	pSkin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
public OnPlayerDisconnect(playerid, reason)
{
	new name[MAX_PLAYER_NAME], file[256];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "/Chrystal Roleplay/Users/%.ini", name);

	dini_IntSet(file,"pSkin", GetPlayerSkin(playerid));
	
    gPlayerLogged[playerid] = 0;
	return 1;
}
And when the players '/register's:
Код:
dini_IntSet(file,"pSkin", 97);
And when the player '/login's:
Код:
SetPlayerSkin(playerid, dini_Int(file, "pSkin"));
Everything is compiling fine, even the variable in the .ini won't save..
So everything in the .ini userfile stays the same... I don't know what
i did wrong, everything seems be right but..

Thanks..

K. Regards,
I. C.
Reply
#2

pawn Код:
format(file, sizeof(file), "/Chrystal Roleplay/Users/%s.ini", name);
Change % to %s.
Reply
#3

MadeMan already told it.
However, Use [ pawn ][ /pawn ] tags please (without the spaces). It's more clearer.
And I have a tip: Use "djson". it's much faster and it works the same as dini.

dini_Exists = djIsSet
dini_Set = djSet
dini_IntSet = djSetInt
dini_FloatSet = djSetFloat
dini_BoolSet = djSetInt
dini_Get = dj
dini_Int = djInt
dini_Float = djFloat
dini_Bool = djInt ? true : false;

It's not hard to compile dini to djson. Just use CTRL+H and replace the dini_* with the dj* stuff. Do you understand ? :P
By the way, here's the topic: https://sampforum.blast.hk/showthread.php?tid=48439
And here I say it's much faster: http://forum.sa-mp.com/showpost.php?...&postcount=312
And as last, all the functions + some explaination: http://dev.dracoblue.net/index.php/DJson

Regards,
Kevin
Reply
#4

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
MadeMan already told it.
However, Use [ pawn ][ /pawn ] tags please (without the spaces). It's more clearer.
And I have a tip: Use "djson". it's much faster and it works the same as dini.

dini_Exists = djIsSet
dini_Set = djSet
dini_IntSet = djSetInt
dini_FloatSet = djSetFloat
dini_BoolSet = djSetInt
dini_Get = dj
dini_Int = djInt
dini_Float = djFloat
dini_Bool = djInt ? true : false;

It's not hard to compile dini to djson. Just use CTRL+H and replace the dini_* with the dj* stuff. Do you understand ? :P
By the way, here's the topic: https://sampforum.blast.hk/showthread.php?tid=48439
And here I say it's much faster: http://forum.sa-mp.com/showpost.php?...&postcount=312
And as last, all the functions + some explaination: http://dev.dracoblue.net/index.php/DJson

Regards,
Kevin
I thank you both, i'm gonna try to use your manner. It sound like the djSon is better
then Dini. I'll give it a try. Thanks.

K. Regards,
I. C.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)