06.01.2012, 02:56
When I log off, my notes aren't saved in the userfile.
This is the code, what's wrong with it?
I search for "Note1" in the userfile but it's not there :/
This is the code, what's wrong with it?
pawn Код:
public SavePlayer(playerid) // NOTES SAVES ONLY!
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Accounts/%s.ini", pName);
new File: UserFile = fopen(string, io_write);
if (UserFile)
{
new var[32];
format(var, 32, "Note1=%s\n", pInfo[playerid][pNote1]);fwrite(UserFile, var);
format(var, 32, "Note2=%s\n", pInfo[playerid][pNote2]);fwrite(UserFile, var);
format(var, 32, "Note3=%s\n", pInfo[playerid][pNote3]);fwrite(UserFile, var);
format(var, 32, "Note4=%s\n", pInfo[playerid][pNote4]);fwrite(UserFile, var);
format(var, 32, "Note5=%s\n", pInfo[playerid][pNote5]);fwrite(UserFile, var);
}
fclose(UserFile);
}