SA-MP Forums Archive
saving - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: saving (/showthread.php?tid=233900)



saving - xir - 02.03.2011

hi, i got a saving thing which saves clans,vehicles etc but i want to change it because it is really ugly when opening a file, also it cant load the clan file when i log in so can anyone help me changing this to a faster and more efficent way

pawn Код:
public OnPlayerDataSave(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(Logged[playerid])
        {
            new string3[256];
            format(string3, sizeof(string3), "Users/%s.ini", PlayerName(playerid));
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
                new var[32];
                format(var, 32, "HouseKey=%d\n",PlayerInfo[playerid][pHouseKey]);fwrite(hFile, var);
                format(var, 32, "CarKey=%d\n",PlayerInfo[playerid][pCarKey]);fwrite(hFile, var);
                format(var, 32, "ClanKey=%d\n",PlayerInfo[playerid][pClanKey]);fwrite(hFile, var);
                fclose(hFile);
            }
        }
    }
    return 1;
}