Dini, writing to files
#1

Forgive me, I used to be somewhat moderately good at this but I've been away for 2 years :P

I'm trying to write some files using Dini but they don't seem to be getting stored, I've got the includes in the right place and the code runs fine but no files are produced.

This is what I have without revealing too much of my code, basically I just want a file to be written when a player connects but it isn't doing so Can anyone help?
pawn Код:
public OnPlayerConnect(playerid)
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\File\\%s.ini", pname);
    dini_Create(file);
    dini_IntSet(file, "test1", 0);
    dini_IntSet(file, "test2", 0);
    dini_IntSet(file, "test3", 0);
    return 1;
}
Reply
#2

Use forward slashes. Windows recognizes backslashes, but forward slashes are guaranteed to work on both OS'. I'll just ignore the sheer fact that you're using dini, for now. (Hint: Y_Ini, DJSon, ..)
Reply
#3

Ah, thanks very much And yes I probably need to check around for new stuff haha
Reply
#4

Also, make sure you make the folder first. If there is no such folder in scriptfiles, dini doesn't create it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)