Y_INI Password problem.
#1

I've been working on a gamemode for a few months now, everything in stats worked fine untill I finished scripting my house system today, now I have password problems. It saves your password when you register, but after a minute or two your account gets deleted and because of the function "SaveAccountStats" everything comes back except the password, since you cant save the password on "SaveAccountStats".
All I can really show you is the saving and loading I guess..
Saving:
pawn Код:
function SaveAccountStats(playerid)
{
if(Logged[playerid] == 1){
    new
        INI:File = INI_Open(UserPath(playerid))
    ;
    INI_SetTag(File,"data");

    PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
    PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
    PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
    PlayerInfo[playerid][pWantedLevel] = GetPlayerWantedLevel(playerid);
    new
        Float:x,
        Float:y,
        Float:z
    ;
    GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
    GetPlayerArmour(playerid,PlayerInfo[playerid][pArmor]);
    GetPlayerPos(playerid,x,y,z);
    PlayerInfo[playerid][pPos_x] = x;
    PlayerInfo[playerid][pPos_y] = y;
    PlayerInfo[playerid][pPos_z] = z;
    GetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
   
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
    INI_WriteInt(File,"ReportMuted",PlayerInfo[playerid][pReportMuted]);
    INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
    INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
    INI_WriteInt(File,"Experience",PlayerInfo[playerid][pExp]);
    INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVip]);
    INI_WriteInt(File,"HouseKey",PlayerInfo[playerid][pHousekey]);
    INI_WriteInt(File,"Phone", PlayerInfo[playerid][pNumber]);
    INI_WriteInt(File,"PhoneBook", PlayerInfo[playerid][pPB]);
    INI_WriteInt(File,"Warns", PlayerInfo[playerid][pWarns]);
    INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
    INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
    INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
    INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
    INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
    INI_WriteFloat(File,"Pos_a",PlayerInfo[playerid][pPos_a]);
    INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
    INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
    INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
    INI_WriteInt(File,"Dice",PlayerInfo[playerid][pDice]);
    INI_WriteInt(File,"Job",PlayerInfo[playerid][pJobID]);
    INI_WriteInt(File,"Weapon1",PlayerInfo[playerid][pWeapon1]);
    INI_WriteInt(File,"Weapon1a",PlayerInfo[playerid][pWeapon1a]);
    INI_WriteInt(File,"Weapon2",PlayerInfo[playerid][pWeapon2]);
    INI_WriteInt(File,"Weapon2a",PlayerInfo[playerid][pWeapon2a]);
    INI_WriteInt(File,"Weapon3",PlayerInfo[playerid][pWeapon3]);
    INI_WriteInt(File,"Weapon3a",PlayerInfo[playerid][pWeapon3a]);
    INI_WriteInt(File,"Weapon4",PlayerInfo[playerid][pWeapon4]);
    INI_WriteInt(File,"Weapon4a",PlayerInfo[playerid][pWeapon4a]);
    INI_WriteInt(File,"Weapon5",PlayerInfo[playerid][pWeapon5]);
    INI_WriteInt(File,"Weapon5a",PlayerInfo[playerid][pWeapon5a]);
    INI_WriteInt(File,"Weapon6",PlayerInfo[playerid][pWeapon6]);
    INI_WriteInt(File,"Weapon6a",PlayerInfo[playerid][pWeapon6a]);
    INI_WriteInt(File,"Weapon7",PlayerInfo[playerid][pWeapon7]);
    INI_WriteInt(File,"Weapon7a",PlayerInfo[playerid][pWeapon7a]);
    INI_WriteInt(File,"Weapon8",PlayerInfo[playerid][pWeapon8]);
    INI_WriteInt(File,"Weapon8a",PlayerInfo[playerid][pWeapon8a]);
    INI_WriteInt(File,"Weapon9",PlayerInfo[playerid][pWeapon9]);
    INI_WriteInt(File,"Weapon9a",PlayerInfo[playerid][pWeapon9a]);
    INI_WriteInt(File,"Weapon10",PlayerInfo[playerid][pWeapon10]);
    INI_WriteInt(File,"Weapon10a",PlayerInfo[playerid][pWeapon10a]);
    INI_WriteInt(File,"Weapon11",PlayerInfo[playerid][pWeapon11]);
    INI_WriteInt(File,"Weapon11a",PlayerInfo[playerid][pWeapon11a]);
    INI_WriteInt(File,"Weapon12",PlayerInfo[playerid][pWeapon12]);
    INI_WriteInt(File,"Weapon12a",PlayerInfo[playerid][pWeapon12a]);
    INI_WriteInt(File,"Deposit",PlayerInfo[playerid][pDeposit]);
    INI_WriteInt(File,"Materials",PlayerInfo[playerid][pMaterials]);
    INI_WriteInt(File,"Packages",PlayerInfo[playerid][pPackages]);
    INI_WriteInt(File,"Cocaine",PlayerInfo[playerid][pCocaine]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
    INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
    INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
    INI_WriteInt(File,"Duty",PlayerInfo[playerid][pDuty]);
    INI_WriteInt(File,"Radio",PlayerInfo[playerid][pRadio]);
    INI_WriteInt(File,"RadioFreq",PlayerInfo[playerid][pRadioFreq]);
    INI_WriteInt(File,"SpamStop",PlayerInfo[playerid][pSpam]);
    INI_WriteInt(File,"VW",PlayerInfo[playerid][pVW]);
    INI_WriteInt(File,"INT",PlayerInfo[playerid][pINT]);
    INI_WriteFloat(File,"Health",PlayerInfo[playerid][pHealth]);
    INI_WriteFloat(File,"Armor",PlayerInfo[playerid][pArmor]);
    INI_WriteInt(File,"Crimes",PlayerInfo[playerid][pCrimes]);
    INI_WriteInt(File,"WantedLevel",PlayerInfo[playerid][pWantedLevel]);
    INI_Close(File);
    }
return 1;
}
Loading of account stats:
pawn Код:
function LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Experience",PlayerInfo[playerid][pExp]);
    INI_Int("VIP",PlayerInfo[playerid][pVip]);
    INI_Int("HouseKey",PlayerInfo[playerid][pHousekey]);
    INI_Int("Number",PlayerInfo[playerid][pNumber]);
    INI_Int("PhoneBook", PlayerInfo[playerid][pPB]);
    INI_Int("Warns",PlayerInfo[playerid][pWarns]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
    INI_Int("ReportMuted",PlayerInfo[playerid][pReportMuted]);
    INI_Int("Muted",PlayerInfo[playerid][pMuted]);
    INI_Int("Sex",PlayerInfo[playerid][pSex]);
    INI_Int("Age",PlayerInfo[playerid][pAge]);
    INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]);
    INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]);
    INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]);
    INI_Float("Pos_a",PlayerInfo[playerid][pPos_a]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("Team",PlayerInfo[playerid][pTeam]);
    INI_Int("Dice",PlayerInfo[playerid][pDice]);
    INI_Int("Accent",PlayerInfo[playerid][pAccent]);
    INI_Int("Job",PlayerInfo[playerid][pJobID]);
    INI_Int("Weapon1",PlayerInfo[playerid][pWeapon1]);
    INI_Int("Weapon1a",PlayerInfo[playerid][pWeapon1a]);
    INI_Int("Weapon2",PlayerInfo[playerid][pWeapon2]);
    INI_Int("Weapon2a",PlayerInfo[playerid][pWeapon2a]);
    INI_Int("Weapon3",PlayerInfo[playerid][pWeapon3]);
    INI_Int("Weapon3a",PlayerInfo[playerid][pWeapon3a]);
    INI_Int("Weapon4",PlayerInfo[playerid][pWeapon4]);
    INI_Int("Weapon4a",PlayerInfo[playerid][pWeapon4a]);
    INI_Int("Weapon5",PlayerInfo[playerid][pWeapon5]);
    INI_Int("Weapon5a",PlayerInfo[playerid][pWeapon5a]);
    INI_Int("Weapon6",PlayerInfo[playerid][pWeapon6]);
    INI_Int("Weapon6a",PlayerInfo[playerid][pWeapon6a]);
    INI_Int("Weapon7",PlayerInfo[playerid][pWeapon7]);
    INI_Int("Weapon7a",PlayerInfo[playerid][pWeapon7a]);
    INI_Int("Weapon8",PlayerInfo[playerid][pWeapon8]);
    INI_Int("Weapon8a",PlayerInfo[playerid][pWeapon8a]);
    INI_Int("Weapon9",PlayerInfo[playerid][pWeapon9]);
    INI_Int("Weapon9a",PlayerInfo[playerid][pWeapon9a]);
    INI_Int("Weapon10",PlayerInfo[playerid][pWeapon10]);
    INI_Int("Weapon10a",PlayerInfo[playerid][pWeapon10a]);
    INI_Int("Weapon11",PlayerInfo[playerid][pWeapon11]);
    INI_Int("Weapon11a",PlayerInfo[playerid][pWeapon11a]);
    INI_Int("Weapon12",PlayerInfo[playerid][pWeapon12]);
    INI_Int("Weapon12a",PlayerInfo[playerid][pWeapon12a]);
    INI_Int("Deposit",PlayerInfo[playerid][pDeposit]);
    INI_Int("Materials",PlayerInfo[playerid][pMaterials]);
    INI_Int("Packages",PlayerInfo[playerid][pPackages]);
    INI_Int("Cocaine",PlayerInfo[playerid][pCocaine]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Faction",PlayerInfo[playerid][pFaction]);
    INI_Int("Rank",PlayerInfo[playerid][pRank]);
    INI_Int("Leader",PlayerInfo[playerid][pLeader]);
    INI_Int("Duty",PlayerInfo[playerid][pDuty]);
    INI_Int("Radio",PlayerInfo[playerid][pRadio]);
    INI_Int("RadioFreq",PlayerInfo[playerid][pRadioFreq]);
    INI_Int("SpamStop",PlayerInfo[playerid][pSpam]);
    INI_Int("VW",PlayerInfo[playerid][pVW]);
    INI_Int("INT",PlayerInfo[playerid][pINT]);
    INI_Float("Health",PlayerInfo[playerid][pHealth]);
    INI_Float("Armor",PlayerInfo[playerid][pArmor]);
    INI_Int("Crimes",PlayerInfo[playerid][pCrimes]);
    INI_Int("WantedLevel",PlayerInfo[playerid][pWantedLevel]);
    print("Loaded Player Information (Name, Age, Job...)");
    return 1;
}
Please help, the game mode's pretty much complete except for this issue.
Reply
#2

Bump (Really need help with this, I even re-wrote the saving and loading code and the problem wasn't resolved).
Reply
#3

I had a problem similar to this. I was unknowingly saving the password under OnPlayerDisconnect, but seems like you're not doing that. Only thing I can advise you doing is doing a forward then a public instead of function. I've never really hassled with function. Always used forward and public.
Reply
#4

No luck, problem still persists , Ah damn if no one can help me I'll maybe TRY to convert the saving & loading to MySQL or something similar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)