Save error
#1

Hi SA:MP Forum!

I have an error. I'd like save the user stats. Everything works except "Siringa virus" and "Siringa medikit"
It saves but saving appears several times.

pawn Код:
[Dati utente]
Admin = 4
Zaino = 2
Arma = 0
Munizioni = 60
Uccisioni = 0
Morti = 0
Status = 1
Livello = 54
Registrato = 1
Pistol = 0
SPistol = 0
Desert = 0
Shotgun = 0
Sawnoff = 0
Spas12 = 0
Uzi = 0
MP5 = 0
AK47 = 0
M4 = 0
Rifle = 0
Militare = 0
Panino = 2
Pizza = 3
Fagioli = 6
Legna = 5
Siringa virus = 0
Siringa medikit = 0
Siringa virus = 0
Siringa medikit = 0
Siringa virus = 0
Siringa medikit = 0
Siringa virus = 0
Siringa medikit = 0
Siringa virus = 0
Siringa medikit = 0
Siringa virus = 0
Siringa medikit = 1
pawn Код:
stock SalvaDati(playerid)
{
new INI:File = INI_Open(UserPath(playerid));

            INI_SetTag( File, "Dati utente" );
           
            INI_WriteInt( File, "Admin", PlayerData[playerid][Admin] );
            INI_WriteInt( File, "Zaino", PlayerData[playerid][Zaino] );
            INI_WriteInt( File, "Arma", PlayerData[playerid][InvArma] );
            INI_WriteInt( File, "Munizioni", PlayerData[playerid][InvAmmo] );
            INI_WriteInt( File, "Munizioni", GetPlayerMoney(playerid));
            INI_WriteInt( File, "Uccisioni", PlayerData[playerid][Uccisioni] );
            INI_WriteInt( File, "Morti", PlayerData[playerid][Morti] );
            INI_WriteInt( File, "Status", Umano[playerid] );
            INI_WriteInt( File, "Livello", PlayerData[playerid][Livello] );
            INI_WriteInt( File, "Registrato", PlayerData[playerid][Registrato] );
            INI_WriteInt(File, "Pistol", PlayerData[playerid][Pistol]);
            INI_WriteInt(File, "SPistol", PlayerData[playerid][SPistol]);
            INI_WriteInt(File, "Desert", PlayerData[playerid][Desert]);
            INI_WriteInt(File, "Shotgun", PlayerData[playerid][Shotgun]);
            INI_WriteInt(File, "Sawnoff", PlayerData[playerid][Sawnoff]);
            INI_WriteInt(File, "Spas12", PlayerData[playerid][Spas12]);
            INI_WriteInt(File, "Uzi", PlayerData[playerid][Uzi]);
            INI_WriteInt(File, "MP5", PlayerData[playerid][MP5]);
            INI_WriteInt(File, "AK47", PlayerData[playerid][AK47]);
            INI_WriteInt(File, "M4", PlayerData[playerid][M4]);
            INI_WriteInt(File, "Rifle", PlayerData[playerid][Rifle]);
            INI_WriteInt(File, "Militare", PlayerData[playerid][Militare]);
            INI_WriteInt(File, "Panino", PlayerData[playerid][Panino]);
            INI_WriteInt(File, "Pizza", PlayerData[playerid][Pizza]);
            INI_WriteInt(File, "Fagioli", PlayerData[playerid][Fagioli]);
            INI_WriteInt( File, "Siringa virus", PlayerData[playerid][SiringaV] );
            INI_WriteInt( File, "Siringa medikit", PlayerData[playerid][SiringaM] );
            INI_WriteInt( File, "Legna", PlayerData[playerid][Legna] );

            INI_Close(File);
             return 1;
             }
pawn Код:
public LoadUser_data(playerid,name[],value[])
{
            INI_Int("Admin", PlayerData[playerid][Admin] );
            INI_Int("Zaino", PlayerData[playerid][Zaino] );
            INI_Int("Arma", PlayerData[playerid][InvArma] );
            INI_Int("Munizioni", PlayerData[playerid][InvAmmo] );
            INI_Int("Soldi", PlayerData[playerid][Soldi] );
            INI_Int("Uccisioni", PlayerData[playerid][Uccisioni] );
            INI_Int("Morti", PlayerData[playerid][Morti] );
            INI_Int("Status", Umano[playerid] );
            INI_Int("Livello", PlayerData[playerid][Livello] );
            INI_Int("Registrato", PlayerData[playerid][Registrato] );
            INI_Int("Pistol", PlayerData[playerid][Pistol]);
            INI_Int("SPistol", PlayerData[playerid][SPistol]);
            INI_Int("Desert", PlayerData[playerid][Desert]);
            INI_Int("Shotgun", PlayerData[playerid][Shotgun]);
            INI_Int("Sawnoff", PlayerData[playerid][Sawnoff]);
            INI_Int("Spas12", PlayerData[playerid][Spas12]);
            INI_Int("Uzi", PlayerData[playerid][Uzi]);
            INI_Int("MP5", PlayerData[playerid][MP5]);
            INI_Int("AK47", PlayerData[playerid][AK47]);
            INI_Int("M4", PlayerData[playerid][M4]);
            INI_Int("Rifle", PlayerData[playerid][Rifle]);
            INI_Int("Militare", PlayerData[playerid][Militare]);
            INI_Int("Orologio", PlayerData[playerid][Orologio]);
            INI_Int("Panino", PlayerData[playerid][Panino]);
            INI_Int("Pizza", PlayerData[playerid][Pizza]);
            INI_Int("Fagioli", PlayerData[playerid][Fagioli]);
            INI_Int("Siringa Virus", PlayerData[playerid][SiringaV] );
            INI_Int("Siringa medikit", PlayerData[playerid][SiringaM] );
            INI_Int("Legna", PlayerData[playerid][Legna] );



    return 1;
}
This error is strange. Help me please.
Reply
#2

Are you sure PlayerData[playerid][SiringaV] is an integer and now an array?
Reply
#3

pawn Код:
enum pData
{
    SiringaV,
    SiringaM,
    Admin,
    InvAmmo,
    InvArma,
    Zaino,
    Soldi,
    Uccisioni,
    Morti,
    Livello,
    Registrato,
    Pistol,
    SPistol,
    Desert,
    Shotgun,
    Sawnoff,
    Spas12,
    Uzi,
    MP5,
    AK47,
    M4,
    Rifle,
    Militare,
    Orologio,
    Panino,
    Pizza,
    Fagioli,
    Legna
};
Reply
#4

UP! Help me.
Reply
#5

its because there is space in "Siringa virus" and "Siringa medikit"
change it to "Siringa_virus" and "Siringa_medikit" in script
that will solve ur problem
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)