Dini does not write to file.
#1

I'm having a difficult time trying to write and read from a file. I've created two commands in my Gamemode: one to record the Name, IP, and Score of a player; and the other one to retrieve the Name and Score of the person. The code looks like this:
pawn Код:
COMMAND:pass(playerid){
    new file[250] = "/userfiles/testing.ini";
   
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    GetPlayerIp(playerid,   PlayerInfo[playerid][pIP],   16);

    PlayerInfo[playerid][pScore] = GetPlayerScore(playerid);
   
    dini_Set( file,   "Name",   PlayerInfo[playerid][pName] );
    dini_Set( file,   "IP",     PlayerInfo[playerid][pIP]);
    dini_IntSet( file, "Score", PlayerInfo[playerid][pScore] );

    return 1;
}
COMMAND:get(playerid){
    new file[250] = "/userfiles/testing.ini";
    new msg[150];
   
    format( msg, sizeof(msg), "Name: %s", dini_Get(file, "Name") );
    SendClientMessage( playerid, BLUE, msg );
    format( msg,sizeof(msg),"Score: %d", dini_Int(file, "Score") );
    SendClientMessage( playerid, BLUE, msg );

    return 1;
}
I've tried different combination for the file name such as:
  • C:\Users\Owner\Desktop\Games\GTA SA\Server\userfiles\testing.ini
  • C:\\Users\\Owner\\Desktop\\Games\\GTA SA\\Server\\userfiles\\testing.ini
  • C:/Users/Owner/Desktop/Games/GTA SA/Server/userfiles/testing.ini
  • \\userfiles\\testing.ini
  • /userfiles/testing.ini
  • userfiles\testing.ini
  • userfiles/testing.ini
Even so, dini_IntSet does not write to the directory where I have the testing.ini file that I manually created in userfiles. I'm running Windows Vista on my computer, so I also tried running my server in Administrator mod, but even that doesn't help. I've done File I/O in the the past (C, Python, and PHP), but this time around I can't figure out why dini isn't working for me. I know that there are better File I/O for Pawno, but right now I'm focusing on dini since I finally figured out how to use it by going over the source code.

Thank you for your time.
Reply


Messages In This Thread
[Solved] Dini does not write to file. - by DesertFoxNight - 09.05.2011, 13:39
Re: Dini does not write to file. - by Biesmen - 09.05.2011, 14:12
Re: Dini does not write to file. - by DesertFoxNight - 09.05.2011, 14:31
Re: Dini does not write to file. - by DesertFoxNight - 09.05.2011, 18:32

Forum Jump:


Users browsing this thread: 1 Guest(s)