[DINI] Won't save - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [DINI] Won't save (
/showthread.php?tid=208605)
[DINI] Won't save -
Ihsan-Cingisiz - 08.01.2011
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.
Re: [DINI] Won't save -
MadeMan - 09.01.2011
pawn Код:
format(file, sizeof(file), "/Chrystal Roleplay/Users/%s.ini", name);
Change % to %s.
Re: [DINI] Won't save -
Kwarde - 09.01.2011
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
Re: [DINI] Won't save -
Ihsan-Cingisiz - 09.01.2011
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.