Accounts not saving/loading on random occasions
#7

Quote:
Originally Posted by JuanStone
Посмотреть сообщение
I work with ini file, and my tags have space, I assure him that what he said makes no sense.

Try this and check if you create the file, it could also be "userpath" the code you eh given should work.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
                {
                    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"San Andreas Border Partrol",""COL_RED"Please choose a password between 4 and 20 characters.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                }
                else if(strlen(inputtext) >= 4 && strlen(inputtext) < 21)
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"Player Data");
                    INI_WriteInt(File,"Password",udb_hash(inputtext));
                    INI_WriteInt(File,"Admin",0);
                    INI_WriteInt(File,"CitySpawn",0);
                    INI_WriteInt(File,"SpawnInHouse",0);
                    INI_WriteInt(File,"Seconds",0);
                    INI_WriteInt(File,"Minutes",0);
                    INI_WriteInt(File,"Hours",0);
                    INI_WriteInt(File,"Money",10000);
                    INI_WriteInt(File,"BankCash",0);
                    INI_WriteInt(File,"Score",0);
                    INI_WriteInt(File,"Grams",0);
                    INI_WriteInt(File,"Seeds",0);
                    INI_WriteInt(File,"Kills",0);
                    INI_WriteInt(File,"Deaths",0);
                    INI_WriteInt(File,"Warnings",0);
                    INI_WriteInt(File,"Skin",0);
                    INI_WriteInt(File,"Team",0);
                    INI_WriteInt(File,"TruckMCompleted",0);
                    INI_WriteInt(File,"Wanted_Level",0);
                    INI_WriteInt(File,"WeaponSlot1",0);
                    INI_WriteInt(File,"WeaponSlot1_Ammo",0);
                    INI_WriteInt(File,"WeaponSlot2",0);
                    INI_WriteInt(File,"WeaponSlot2_Ammo",0);
                    INI_WriteInt(File,"WeaponSlot3",0);
                    INI_WriteInt(File,"WeaponSlot3_Ammo",0);
                    INI_WriteInt(File,"WeaponSlot4",28);
                    INI_WriteInt(File,"WeaponSlot4_Ammo",1000);
                    INI_WriteInt(File,"WeaponSlot5",0);
                    INI_WriteInt(File,"WeaponSlot5_Ammo",0);
                    INI_WriteInt(File,"WeaponSlot6",0);
                    INI_WriteInt(File,"WeaponSlot6_Ammo",0);
                    INI_Close(File);

                    Info[playerid][Logged] = true;
                    TogglePlayerSpectating(playerid,0);
                    SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered. You can now choose your team.");
                    SetTimerEx("GameTimeStats", 1000, 1, "i", playerid);
                }
            }
        }
    }
    return true;
}
Well the way you offered, does in fact, create files and loads them, but does NOT save player data for some reason.....

Quote:
Originally Posted by biker122
Посмотреть сообщение
It does make sense.
1. You use spaces while writing the field / tag names.
2. You don't save the players' stats in OnPlayerDisconnect (if you actually have a saving code there, check for spaces in your fields (INI_SetTag, INI_WriteInt, INI_WriteString, INI_WriteFloat)
As the way you offered does create files, saves player data, but does not load and will not allow a player to login...

:/
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)