SA-MP Forums Archive
dini_Create crashes? - 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_Create crashes? (/showthread.php?tid=173446)



dini_Create crashes? - rbN. - 02.09.2010

So, I got this:

pawn Код:
new file[256],name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(file,sizeof(file),"Test/%s.sav",name);
            if(!dini_Exists(file))
            {
                dini_Create(file);
                SendClientMessage(playerid, c_r, "ACCOUNT CREATED");
                print("ACCOUNT CREATED");
            }
            else print("ACCOUNT ALREADY EXIST");
The problem is, that my server crashes when this happends. It doesn't when format(file,sizeof(file),"Test/%s.sav",name); is replaced with format(file,sizeof(file),"%s.sav",name); (Without /Test)..

How could I do that it saves in a map?


Re: dini_Create in crashes? - JaTochNietDan - 02.09.2010

Quote:
Originally Posted by RobinOwnz
Посмотреть сообщение
So, I got this:

pawn Код:
new file[256],name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            format(file,sizeof(file),"Test/%s.sav",name);
            if(!dini_Exists(file))
            {
                dini_Create(file);
                SendClientMessage(playerid, c_r, "ACCOUNT CREATED");
                print("ACCOUNT CREATED");
            }
            else print("ACCOUNT ALREADY EXIST");
The problem is, that my server crashes when this happends. It doesn't when format(file,sizeof(file),"Test/%s.sav",name); is replaced with format(file,sizeof(file),"%s.sav",name); (Without /Test)..

How could I do that it saves in a map?
Do you have the folder "Test" created in the Scriptfiles directory?


Re: dini_Create crashes? - rbN. - 02.09.2010

i fail :<..

next questions.. In the file it says something like this: "Test: 51, 74, 85". How could you write more then one thing at a file. Also, how could you check if that number is in the file?


Re: dini_Create crashes? - JaTochNietDan - 02.09.2010

Quote:
Originally Posted by RobinOwnz
Посмотреть сообщение
i fail :<..

next questions.. In the file it says something like this: "Test: 51, 74, 85". How could you write more then one thing at a file. Also, how could you check if that number is in the file?
Well you can use dini_Set to write information to a line of your choice.

Then to get the information you can use dini_Get and if required, split the line using split or sscanf with a delimiter of your choice.