Dini, writing to files - 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: Dini, writing to files (
/showthread.php?tid=349940)
Dini, writing to files -
V1ceC1ty - 10.06.2012
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;
}
Re: Dini, writing to files -
Vince - 10.06.2012
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, ..)
Re: Dini, writing to files -
V1ceC1ty - 10.06.2012
Ah, thanks very much
And yes I probably need to check around for new stuff haha
Re: Dini, writing to files -
Yuryfury - 10.06.2012
Also, make sure you make the folder first. If there is no such folder in scriptfiles, dini doesn't create it.