Its this converted from dini to y_ini good? - 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: Its this converted from dini to y_ini good? (
/showthread.php?tid=545114)
Its this converted from dini to y_ini good? -
GBLTeam - 06.11.2014
Im trying to convert my gamemode which using the dini to y_ini.. I wanna someone to check this links and tell me if that's good, here i cant use an [pawn] because it has too many lines.
Dini:
http://pastebin.com/SsUcZ2ZZ
Y_Ini(converted by me):
http://pastebin.com/67x2E43J
Re: Its this converted from dini to y_ini good? -
dusk - 06.11.2014
pawn Код:
new INI:File = INI_Open(users(playerid));
INI_SetTag(File,"data");
Isn't
LoadUser_data the function which you set with INI_ParseFile? If so, you do not need to open the file as it is already open. Following that, why are you setting the tag to the one that's already there?
Re: Its this converted from dini to y_ini good? -
GBLTeam - 06.11.2014
Quote:
Originally Posted by dusk
pawn Код:
new INI:File = INI_Open(users(playerid)); INI_SetTag(File,"data");
Isn't LoadUser_data the function which you set with INI_ParseFile? If so, you do not need to open the file as it is already open. Following that, why are you setting the tag to the one that's already there?
|
So what to use instead of this:
pawn Код:
new file[64];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
if(!dini_Exists(file)) dini_Create(file);
Re: Its this converted from dini to y_ini good? -
dusk - 06.11.2014
There are lots of tutorials for stuff like that. You should use the INI_ParseFile function to open files witch have names that you only get in runtime.
Here is a useful tutorial for y_ini.
pawn Код:
new file[64];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
INI_ParseFile(file, "LoadUser_%s", .bExtra = true, .extra = playerid);