SA-MP Forums Archive
Dont saved. - 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: Dont saved. (/showthread.php?tid=112071)



Dont saved. - Justsmile - 05.12.2009

Nothing will be saved.

pawn Код:
public OnPlayerAccountUpdate(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 1)
        {
            new string3[32];
            //new query[128];
            new playername3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername3, sizeof(playername3));
            format(string3, sizeof(string3), "%s.ini", playername3);
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
                new var[32];
                format(var, 32, "Key=%s\n",AccountInfo[playerid][aKey]);fwrite(hFile, var);
                AccountInfo[playerid][aCash] = PlayerMoney[playerid];
                format(var, 32, "LoggedIn=%d\n",AccountInfo[playerid][aLogged]);fwrite(hFile, var);
                format(var, 32, "AdminLevel=%d\n",AccountInfo[playerid][aAdmin]);fwrite(hFile, var);
                format(var, 32, "Spawned=%d\n",AccountInfo[playerid][aSpawned]);fwrite(hFile, var);
                format(var, 32, "Leader=%d\n",AccountInfo[playerid][aLeader]);fwrite(hFile, var);
                format(var, 32, "Member=%d\n",AccountInfo[playerid][aMember]);fwrite(hFile, var);
                format(var, 32, "BankAccount=%d\n",AccountInfo[playerid][aBank]);fwrite(hFile, var);
                //AccountInfo[playerid][aCash] = PlayerMoney[playerid];
                format(var, 32, "Cash=%d\n",PlayerMoney[playerid]);fwrite(hFile, var);
                format(var, 32, "HouseKey=%d\n",AccountInfo[playerid][aHouseKey]);fwrite(hFile, var);
                format(var, 32, "HouseRentKey=%d\n",AccountInfo[playerid][aHouseRentKey]);fwrite(hFile, var);
                format(var, 32, "Language=%d\n",AccountInfo[playerid][aLanguage]);fwrite(hFile, var);
                format(var, 32, "PlayedHours=%d\n",AccountInfo[playerid][aPlayedHours]);fwrite(hFile, var);
                format(var, 32, "Skill=%d\n",AccountInfo[playerid][aSkill]);fwrite(hFile, var);
                format(var, 32, "Level=%d\n",AccountInfo[playerid][aLevel]);fwrite(hFile, var);
                format(var, 32, "PayDayTime=%d\n",AccountInfo[playerid][aPayDayTime]);fwrite(hFile, var);
                format(var, 32, "ConnectTime=%d\n",AccountInfo[playerid][aConnectTime]);fwrite(hFile, var);
                format(var, 32, "Rank=%d\n",AccountInfo[playerid][aRank]);fwrite(hFile, var);
                format(var, 32, "DonateRank=%d\n",AccountInfo[playerid][aDonateRank]);fwrite(hFile, var);
                format(var, 32, "Job=%d\n",AccountInfo[playerid][aJob]);fwrite(hFile, var);
                format(var, 32, "DriveLicense=%d\n",AccountInfo[playerid][aDriveLicense]);fwrite(hFile, var);
                format(var, 32, "BikeLicense=%d\n",AccountInfo[playerid][aBikeLicense]);fwrite(hFile, var);
                format(var, 32, "FlyLicense=%d\n",AccountInfo[playerid][aFlyLicense]);fwrite(hFile, var);
                format(var, 32, "TruckLicense=%d\n",AccountInfo[playerid][aTruckLicense]);fwrite(hFile, var);
                format(var, 32, "BoatLicense=%d\n",AccountInfo[playerid][aBoatLicense]);fwrite(hFile, var);
                format(var, 32, "Model=%d\n",AccountInfo[playerid][aModel]);fwrite(hFile, var);
                print("saved");
              fclose(hFile);
            }
        }
    }
    return 1;
}



Re: Dont saved. - RyDeR` - 05.12.2009

Put OnPlayerAccountUpdate(playerid); under OnPlayerDisconnect or a timer or sometin


Re: Dont saved. - Justsmile - 06.12.2009

I've don it, but nothing will be saved.


Re: Dont saved. - Justsmile - 06.12.2009

Thanks, seif. You'r the one