Saving/Loading System using dini
#1

I am using a function that creates account data when register is successful but the problem that dini doesn't store all the things that I give, It only stores 64 line.

The method I am using:
pawn Код:
public CreateAccount(filename[], playerid)
{
    if(dini_Int(filename, "Logged") == 1)
    {
        new second;
        TotalRegistered++;
        pInfo[playerid][Logged] = 1;
        dini_IntSet(filename, "Level", 1);
        dini_Set(filename, "NormalName", GetName(playerid));
        dini_IntSet(filename, "AdmLevel", 0);
        dini_IntSet(filename, "AdmDuty", 0);
        dini_IntSet(filename, "MapLeader", 0);
        dini_IntSet(filename, "Mapper", 0);
        dini_Set(filename, "AdmName", "");
        dini_Set(filename, "Email", pInfo[playerid][Email]);
        dini_IntSet(filename, "HelpLevel", 0);
        dini_Set(filename, "Pass", pInfo[playerid][Pass]);
        dini_IntSet(filename, "Donator", 0);
        dini_IntSet(filename, "Banned", 0);
        dini_Set(filename, "BannedBy", "");
        dini_Set(filename, "BanReason", "");
        dini_IntSet(filename, "Age", pInfo[playerid][Age]);
        dini_IntSet(filename, "Gender", pInfo[playerid][Gender]);
        dini_Set(filename, "RegisterOn", pInfo[playerid][RegisterOn]);
        dini_IntSet(filename, "Skin", NOOB_SKIN);
        dini_FloatSet(filename, "LastPosX", NOOB_POSX);
        dini_FloatSet(filename, "LastPosY", NOOB_POSY);
        dini_FloatSet(filename, "LastPosZ", NOOB_POSZ);
        dini_FloatSet(filename, "LastPosA", NOOB_POSA);
        dini_IntSet(filename, "LastInt", NOOB_INT);
        dini_IntSet(filename, "LastVw", NOOB_VW);
        dini_IntSet(filename, "Warns", 0);
        dini_IntSet(filename, "Gang", 0);
        dini_IntSet(filename, "Faction", 0);
        dini_IntSet(filename, "Leader", 0);
        dini_IntSet(filename, "Rank", 0);
        dini_IntSet(filename, "Job", 0);
        dini_IntSet(filename, "Job2", 0);
        dini_IntSet(filename, "NewbMute", 0);
        dini_IntSet(filename, "togNewbie", 0);
        dini_IntSet(filename, "OOCMute", 0);
        dini_IntSet(filename, "togOOC", 0);
        dini_IntSet(filename, "AdMute", 0);
        dini_IntSet(filename, "NormMute", 0);
        dini_IntSet(filename, "Money", NOOB_MONEY);
        dini_IntSet(filename, "Bank", NOOB_BANK);
        dini_IntSet(filename, "Crimes", 0);
        dini_IntSet(filename, "Arrested", 0);
        dini_IntSet(filename, "WantedLevel", 0);
        dini_FloatSet(filename, "Health", 100.0);
        dini_FloatSet(filename, "Armour", 0.0);
        dini_IntSet(filename, "Pot", 0);
        dini_IntSet(filename, "Cocaine", 0);
        dini_IntSet(filename, "Package", 0);
        dini_IntSet(filename, "Crate", 0);
        dini_IntSet(filename, "Radio", 0);
        dini_IntSet(filename, "RadioFreq", 0);
        dini_IntSet(filename, "PhoneBook", 0);
        dini_IntSet(filename, "Mats", 0);
        dini_IntSet(filename, "Rope", 0);
        dini_IntSet(filename, "Weap1", 0);
        dini_IntSet(filename, "WeapAmmo1", 0);
        dini_IntSet(filename, "Weap2", 0);
        dini_IntSet(filename, "WeapAmmo2", 0);
        dini_IntSet(filename, "Weap3", 0);
        dini_IntSet(filename, "WeapAmmo3", 0);
        dini_IntSet(filename, "Weap4", 0);
        dini_IntSet(filename, "WeapAmmo4", 0);
        dini_IntSet(filename, "Weap5", 0);
        dini_IntSet(filename, "WeapAmmo5", 0);
        dini_IntSet(filename, "Weap6", 0);//le7d hna bs leh?
        dini_IntSet(filename, "WeapAmmo6", 0);
        dini_IntSet(filename, "Weap7", 0);
        dini_IntSet(filename, "WeapAmmo7", 0);
        dini_IntSet(filename, "Weap8", 0);
        dini_IntSet(filename, "WeapAmmo8", 0);
        dini_IntSet(filename, "Weap9", 0);
        dini_IntSet(filename, "WeapAmmo9", 0);
        dini_IntSet(filename, "Weap10", 0);
        dini_IntSet(filename, "WeapAmmo10", 0);
        dini_IntSet(filename, "Weap11", 0);
        dini_IntSet(filename, "WeapAmmo11", 0);
        dini_IntSet(filename, "Weap12", 0);
        dini_IntSet(filename, "WeapAmmo12", 0);
        dini_IntSet(filename, "Weap13", 0);
        dini_IntSet(filename, "WeapAmmo13", 0);
        dini_IntSet(filename, "House", 0);
        dini_IntSet(filename, "House2", 0);
        dini_IntSet(filename, "Renting", 0);
        dini_IntSet(filename, "Jailed", 0);
        dini_IntSet(filename, "JailTime", 0);
        dini_Set(filename, "JailedBy", "");
        dini_Set(filename, "JailReason", "");
        dini_IntSet(filename, "Accent", 1);
        dini_IntSet(filename, "Married", 0);
        dini_Set(filename, "MarriedTo", "");
        dini_Set(filename, "ReferredBy", pInfo[playerid][ReferredBy]);
        #if defined OPENING
        dini_IntSet(filename, "Tokens", 5);
        #else
        dini_IntSet(filename, "Tokens", 0);
        #endif
        gettime(pInfo[playerid][LastHour], pInfo[playerid][LastMinute], second);
        getdate(pInfo[playerid][LastYear], pInfo[playerid][LastMonth], pInfo[playerid][LastDay]);
        dini_IntSet(filename, "LastHour", pInfo[playerid][LastHour]);
        dini_IntSet(filename, "LastMinute", pInfo[playerid][LastMinute]);
        dini_IntSet(filename, "LastDay", pInfo[playerid][LastDay]);
        dini_IntSet(filename, "LastMonth", pInfo[playerid][LastMonth]);
        dini_IntSet(filename, "LastYear", pInfo[playerid][LastYear]);
        dini_Set(filename, "LastIP", pInfo[playerid][IP]);
    }
    return 1;
}
Account File:
Код:
Logged=1
Level=1
NormalName=John Romel
AdmLevel=0
AdmDuty=0
MapLeader=0
Mapper=0
AdmName=
Email=lol@lol.lol
HelpLevel=0
Pass=F2BA79098F5F37BBD4EE105894EC1EE73205B584VA615E24B576C287A7ABC6EF0B72AB43D128083494497F4EE2282CA6F24EEE9C70BC03453D81995BDA9F6991
Donator=0
Banned=0
BannedBy=
BanReason=
Age=0
Gender=0
RegisterOn=7/2/2019
Skin=299
LastPosX=761.065917
LastPosY=-1564.072387
LastPosZ=13.928899
LastPosA=-89.287498
LastInt=0
LastVw=0
Warns=0
Gang=0
Faction=0
Leader=0
Rank=0
Job=0
Job2=0
NewbMute=0
togNewbie=0
OOCMute=0
togOOC=0
AdMute=0
NormMute=0
Money=250
Bank=500
Crimes=0
Arrested=0
WantedLevel=0
Health=100.000000
Armour=0.000000
Pot=0
Cocaine=0
Package=0
Crate=0
Radio=0
RadioFreq=0
PhoneBook=0
Mats=0
Rope=0
Weap1=0
WeapAmmo1=0
Weap2=0
WeapAmmo2=0
Weap3=0
WeapAmmo3=0
Weap4=0
WeapAmmo4=0
Weap5=0
WeapAmmo5=0
Reply
#2

Why are you using dini? Bad choice.
Reply
#3

try to use y_ini or mysql / sqlite
Reply
#4

Guys, The question about dini, I know that it's so bad, If you know the answer about my question just say it and no more please.
Reply
#5

no one uses something bad and yOu ArE bEiNg RuDe
Reply
#6

I am not rude, I asked a question about smth, just answer if you can help, if not don't waste your time or mine.
Reply
#7

Make more files for same player (very very intelligent)
Reply
#8

Any other suggestion?
Reply
#9

Excuse me, i don't wanna be "RuDe" but i don't think someone will help you, not because we're a bunch of uneducated people, but just because Dini has almost 13 years. It's slow and unefficient.

Can i give you a suggestion? Switch to MySQL, your server will breath with opened lungs.
Reply
#10

Can you guys get off your high horses and actually help him instead of insulting? We know you guys are soo much better but you've all been beginners at some point.

Anyway, I don't think the problem is in the lines of code you're showing. It might be in the dini include but I'm no expert.
Reply
#11

Yep.


1. It has to do with the Dini include.

2. Do not use any file based saving/ loading system.

3. Use SQLite (or MYSQL) it\'s easy as ABC, you\'ll get the hang of it. Distribute data among different tables, load house data from house table, user data from user data and admin data from admins table. Having too many fields in one table isn\'t good either. It\'s also speedy and comes handy in times (sorting data, linking data, contributes to your web and database knowledge, etc)

4. Don\'t beg for answers for something that\'s obsolete.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)