SA-MP Forums Archive
[Help] y_ini Save/Load - 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_ini Save/Load (/showthread.php?tid=402012)



[Help] y_ini Save/Load - vannesenn - 24.12.2012

I've had some problems with saving and loading data from a file. I fixed it . Under Dialog to login've put me on Resets all arrays Default (Public ResetVarbdijali). After registering Relog do, and then I pick up (when I log back) arrays of Publica ResetVarbdijali. I do not know about you, but I think my Public LoadUser_data not work. Do we can see what's wrong here?

Public LoadUser_data I put in the Login Dialog

Tnx, and Merry Christmas


Код:
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    INI_Int("Godine",PlayerInfo[playerid][pGodine]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("GameMaster",PlayerInfo[playerid][pGameMaster]);
    INI_Int("Lider",PlayerInfo[playerid][pLeader]);
    INI_Int("Member",PlayerInfo[playerid][pMember]);
    INI_Int("Grad",PlayerInfo[playerid][pGrad]);
    INI_Int("Posao",PlayerInfo[playerid][pPosao]);
    INI_Int("Spol",PlayerInfo[playerid][pSpol]);
    INI_Int("Ban",PlayerInfo[playerid][pBan]);
    INI_Int("Broj",PlayerInfo[playerid][pBroj]);
    INI_Int("Mobitel",PlayerInfo[playerid][pMobitel]);
    INI_Int("Rank",PlayerInfo[playerid][pRank]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Respect",PlayerInfo[playerid][pRespect]);
    INI_Int("SatiIgranja",PlayerInfo[playerid][pSatiIgranja]);
    INI_Int("Donator",PlayerInfo[playerid][pDonator]);
    INI_Int("CheesBurgerRacun",PlayerInfo[playerid][pCheesBurgerRacun]);
    INI_Int("CheesBurger",PlayerInfo[playerid][pCheesBurger]);
    INI_Int("TopliSendvicRacun",PlayerInfo[playerid][pTopliSendvicRacun]);
    INI_Int("TopliSendvic",PlayerInfo[playerid][pTopliSendvic]);
    INI_Int("BurgerRacun",PlayerInfo[playerid][pBurgerRacun]);
    INI_Int("Burger",PlayerInfo[playerid][pBurger]);
    INI_Int("PostanskiUred",PlayerInfo[playerid][pPostanskiUred]);
    INI_Int("IlegalniPosao",PlayerInfo[playerid][pIlegalniPosao]);
    INI_Int("Bolest",PlayerInfo[playerid][pBolest]);
	INI_Int("Povijest",PlayerInfo[playerid][pProslost]);
 	INI_Int("Maska",PlayerInfo[playerid][pMaska]);
	INI_Int("RadniStaz",PlayerInfo[playerid][pRadniStaz]);
	INI_Int("Ugovor",PlayerInfo[playerid][pUgovor]);
	INI_Int("Kredit",PlayerInfo[playerid][pKredit]);
	INI_Int("KreditRata",PlayerInfo[playerid][pKreditRata]);
	INI_Int("StopaKredita",PlayerInfo[playerid][pStopaKredita]);
	INI_Int("Biznis",PlayerInfo[playerid][pPbiskey]);
	INI_Int("Banka",PlayerInfo[playerid][pBanka]);
	INI_Int("Kartica",PlayerInfo[playerid][pKartica]);
	INI_Int("Kuca",PlayerInfo[playerid][pPhousekey]);
	INI_Int("OIB",PlayerInfo[playerid][pOIB]);
	INI_Int("Osobna",PlayerInfo[playerid][pOsobna]);
	INI_Int("Fine1",PlayerInfo[playerid][pFine1]);
    INI_Int("Fine2",PlayerInfo[playerid][pFine2]);
    INI_Int("Fine3",PlayerInfo[playerid][pFine3]);
    INI_Int("Fine4",PlayerInfo[playerid][pFine4]);
    INI_Int("Fine5",PlayerInfo[playerid][pFine5]);
    INI_Int("Droga",PlayerInfo[playerid][pDroga]);
    INI_Int("Sirovine",PlayerInfo[playerid][pMats]);
    INI_Int("Zatvor",PlayerInfo[playerid][pZatvor]);
    INI_Int("Area",PlayerInfo[playerid][pArea]);
    INI_Int("Bon",PlayerInfo[playerid][pBon]);
    return 1;
}
Код:
    if(dialogid == DIALOG_LOGIN)
    {
        ResetVarbdijali(playerid);
        if ( !response ) return Kick ( playerid );
        if( response )
        {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    new loginname[64];
                    GetPlayerName(playerid,loginname,sizeof(loginname));
	                }
	                else
	                {
	                new loginstring[512];
	           		new loginname[64];
	           		GetPlayerName(playerid,loginname,sizeof(loginname));
	                format(loginstring,sizeof(loginstring),"Dobro dosli natrag na Server %s\n\nUpisali ste krivu sifru\n\nVi imate Account na Serveru!\n\nUpisite tocan Password da se Logirate\nForum: Uskoro!\n\nUpisite vasi lozinku...",loginname);
	                SPD(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Kriva sifra | Login",loginstring,"Login","Odustani");
	                SpawnPlayer(playerid);
	                }
	           	}
	        }



Re: [Help] y_ini Save/Load - vannesenn - 24.12.2012

I fixed this problem. Lock