SA-MP Forums Archive
Help - Y_ISI - 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)
+--- Thread: Help - Y_ISI (/showthread.php?tid=544406)



Help - Y_ISI - Edw - 01.11.2014

Hello, I'm back again with this problem.
Namely, account data is saved around.

What I noticed is that if we in pawno / include only YSI GM has 4k kb and shows the correct data and if all include GM bag has kb are normal and inverted data.

PHP код:
enum pInfo
{
    
pPass,
    
pLevel,
    
pMoney,
    
pAdmin,
    
pHelper,
    
pMember,
    
pLeader,
    
pSex,
    
pAge,
    
pEmail,
    
pSkin,
    
pLanguage
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
Help me.


Respuesta: Help - Y_ISI - !R1Ch@rD! - 01.11.2014

I do not understand your question, can you explain?


Re: Help - Y_ISI - Dziugsas - 01.11.2014

if i get it right , its not here where it depends how it writes in the file , its either on OnPlayerDisconnect or either in your PlayerInfo saving function , not the enum.


Re: Help - Y_ISI - Edw - 01.11.2014

Man, I understand everything that is saved just in a different order. that's the problem


Re: Help - Y_ISI - Dziugsas - 01.11.2014

show Onplayerdisconnect callback


Re: Help - Y_ISI - Edw - 01.11.2014

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    // ===== Login and Register =====
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
    INI_WriteInt(File,"Money",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Helper",PlayerInfo[playerid][pHelper]);
    INI_WriteInt(File,"Member",PlayerInfo[playerid][pMember]);
    INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
    INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
    INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
    INI_WriteInt(File,"Email",PlayerInfo[playerid][pEmail]);
    INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
    INI_WriteInt(File,"Language",PlayerInfo[playerid][pLanguage]);
    INI_Close(File);
      return 1;
}

public OnGameModeExit()
{
    // ===== Login and Register =====
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new INI:File = INI_Open(UserPath(i));
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Level",PlayerInfo[i][pLevel]);
            INI_WriteInt(File,"Money",GetPlayerMoney(i));
            INI_WriteInt(File,"Admin",PlayerInfo[i][pAdmin]);
            INI_WriteInt(File,"Helper",PlayerInfo[i][pHelper]);
            INI_WriteInt(File,"Member",PlayerInfo[i][pMember]);
            INI_WriteInt(File,"Leader",PlayerInfo[i][pLeader]);
            INI_WriteInt(File,"Sex",PlayerInfo[i][pSex]);
            INI_WriteInt(File,"Age",PlayerInfo[i][pAge]);
            INI_WriteInt(File,"Email",PlayerInfo[i][pEmail]);
            INI_WriteInt(File,"Skin",PlayerInfo[i][pSkin]);
            INI_WriteInt(File,"Language",PlayerInfo[i][pLanguage]);
            INI_Close(File);
        }
    }
    return 1;
}


forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Money",PlayerInfo[playerid][pMoney]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Helper",PlayerInfo[playerid][pHelper]);
    INI_Int("Member",PlayerInfo[playerid][pMember]);
    INI_Int("Leader",PlayerInfo[playerid][pLeader]);
    INI_Int("Sex",PlayerInfo[playerid][pSex]);
    INI_Int("Age",PlayerInfo[playerid][pAge]);
    INI_Int("Email",PlayerInfo[playerid][pEmail]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("Language",PlayerInfo[playerid][pLanguage]);
    return 1;
}



Re: Help - Y_ISI - Dziugsas - 01.11.2014

how do you want it to be ordered?


Re: Help - Y_ISI - Edw - 01.11.2014

Not saved properly in that .txt file, the game did not bother me problems but it does not look right.

PHP код:
so there must be
Pass 
x
Leve 
x
Money 
x
Admin 
x
Helper 
x
Member 
x
Leader 
x
Sex 
x
Age 
x
Email 
x
Skin 
x
Language 

not so: http://i.imgur.com/mZef43F.png



Re: Help - Y_ISI - Edw - 01.11.2014

help


Re: Help - Y_ISI - Edw - 02.11.2014

up!!!!