Saving files
#4

Quote:
Originally Posted by uprp
View Post
Try this.
pawn Code:
forward SavePlayerStats(playerid);
public SavePlayerStats(playerid) // CONTAINS BUGGING INFORMATION
{
    new INI:file = INI_Open(UserPath(playerid));
    INI_SetTag(file, "data");
    INI_WriteInt(file, "Money", PlayerInfo[playerid][pMoney]); printf("Saved money %s", GetName(playerid));
    INI_WriteInt(file, "Score", PlayerInfo[playerid][pScore]); printf("Saved score %s", GetName(playerid));
    INI_WriteInt(file, "Admin level", PlayerInfo[playerid][pAdmin]); printf("Saved admin level %s", GetName(playerid));
    INI_WriteInt(file, "Vip level", PlayerInfo[playerid][pVip]); printf("Saved vip level %s", GetName(playerid));
    INI_WriteInt(file, "Commands used", PlayerInfo[playerid][pCMD]); printf("Saved commands used %s", GetName(playerid));
    INI_SetTag(file, "kills");      // kills tag
    INI_WriteInt(file, "RKills", PlayerInfo[playerid][pRKills]); printf("Saved last round kills %s", GetName(playerid));
    INI_WriteInt(file, "RDeaths", PlayerInfo[playerid][pRDeaths]); printf("Saved last round deaths %s", GetName(playerid));
    INI_WriteInt(file, "RKD", PlayerInfo[playerid][pRKd]); printf("Saved last round kd %s", GetName(playerid));
    INI_WriteInt(file, "Kills", PlayerInfo[playerid][pKills]); printf("Saved total kills %s", GetName(playerid));
    INI_WriteInt(file, "Deaths", PlayerInfo[playerid][pDeaths]); printf("Saved total deaths %s", GetName(playerid));
    INI_WriteInt(file, "KD", PlayerInfo[playerid][pKd]); printf("Saved total kd %s", GetName(playerid));
    INI_SetTag(file, "weapons");        // weapons tag
    INI_WriteInt(file, "Weapon 0", WeaponInfo[playerid][pWeapon0]); printf("Saved Weaponinfo0 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 1", WeaponInfo[playerid][pWeapon1]); printf("Saved Weaponinfo1 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 2", WeaponInfo[playerid][pWeapon2]); printf("Saved Weaponinfo2 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 3", WeaponInfo[playerid][pWeapon3]); printf("Saved Weaponinfo3 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 4", WeaponInfo[playerid][pWeapon4]); printf("Saved Weaponinfo4 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 5", WeaponInfo[playerid][pWeapon5]); printf("Saved Weaponinfo5 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 6", WeaponInfo[playerid][pWeapon6]); printf("Saved Weaponinfo6 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 7", WeaponInfo[playerid][pWeapon7]); printf("Saved Weaponinfo7 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 8", WeaponInfo[playerid][pWeapon8]); printf("Saved Weaponinfo8 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 9", WeaponInfo[playerid][pWeapon9]); printf("Saved Weaponinfo9 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 10", WeaponInfo[playerid][pWeapon10]); printf("Saved Weaponinfo10 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 11", WeaponInfo[playerid][pWeapon11]); printf("Saved Weaponinfo11 %s", GetName(playerid));
    INI_SetTag(file, "weapons ammo");       // ammo tag
    INI_WriteInt(file, "Weapon 0 ammo", WeaponInfo[playerid][pAmmo0]); printf("Saved Weaponammo0 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 1 ammo", WeaponInfo[playerid][pAmmo1]); printf("Saved Weaponammo1 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 2 ammo", WeaponInfo[playerid][pAmmo2]); printf("Saved Weaponammo2 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 3 ammo", WeaponInfo[playerid][pAmmo3]); printf("Saved Weaponammo3 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 4 ammo", WeaponInfo[playerid][pAmmo4]); printf("Saved Weaponammo4 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 5 ammo", WeaponInfo[playerid][pAmmo5]); printf("Saved Weaponammo5 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 6 ammo", WeaponInfo[playerid][pAmmo6]); printf("Saved Weaponammo6 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 7 ammo", WeaponInfo[playerid][pAmmo7]); printf("Saved Weaponammo7 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 8 ammo", WeaponInfo[playerid][pAmmo8]); printf("Saved Weaponammo8 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 9 ammo", WeaponInfo[playerid][pAmmo9]); printf("Saved Weaponammo9 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 10 ammo", WeaponInfo[playerid][pAmmo10]); printf("Saved Weaponammo10 %s", GetName(playerid));
    INI_WriteInt(file, "Weapon 11 ammo", WeaponInfo[playerid][pAmmo11]); printf("Saved Weaponammo11 %s", GetName(playerid));
    INI_Close(file);
    return 1;
}

Please repme if i helped.

Also try SaveServerStats.
It wont make any difference if you just rename the function. It DOES save, just not the right way
Reply


Messages In This Thread
Saving files - by Wesley221 - 23.08.2011, 14:59
Re: Saving files - by Wesley221 - 23.08.2011, 17:33
Respuesta: Saving files - by uprp - 23.08.2011, 20:36
Re: Respuesta: Saving files - by Wesley221 - 24.08.2011, 08:34
Re: Saving files - by Wesley221 - 24.08.2011, 10:05

Forum Jump:


Users browsing this thread: 2 Guest(s)