dini_Create crashes?
#1

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

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)