Its this converted from dini to y_ini good?
#1

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

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?
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)