Dini doesn't create the file
#1

I tryied to make a register system on a fs but dini did't create the files, then i made the fs a gamemode, and the same problem. I tryied even with Zh3r0's register system with Y_INI and the same problem.
pawn Код:
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new string3[64];
        new playername3[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername3, sizeof(playername3));
        format(string3, sizeof(string3), "Accounts/%s.ini", playername3);

        dini_Create(string3);
        new password2 = num_hash(password);
        PlayerInfo[playerid][Pass] = password2;
        dini_IntSet(string3, "Password",password2);
        dini_IntSet(string3, "Level",PlayerInfo[playerid][Level]);
        dini_IntSet(string3, "Money",PlayerInfo[playerid][Money]);
        ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Bun Venit",""ALB"Cont inregistrat cu succes!\n"ALB"Scrie parola ta mai jos pentru a te loga","Log-in","Quit");
    }
    return 1;
}
Reply
#2

Try:

Код:
new File[128];
Код:
dini_Create(file);
Код:
dini_Set(File, ....
Код:
dini_IntSet(File, ....
Reply
#3

pawn Код:
public OnPlayerRegister(playerid, password) // [] isn't needed as the password is a integer (whole number)
{
    if(IsPlayerConnected(playerid))
    {
        new file[64];
        new playername3[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername3, sizeof(playername3));
        format(file, sizeof(file), "Accounts/%s.ini", playername3);

        if(dini_Exists(file))
        {
            return SendClientMessage(playerid,COLOR_WHITE,"This account is already registered.");
        }
        else
        {
            dini_Create(file);
            new password2 = num_hash(password);
            PlayerInfo[playerid][Pass] = password2;
            dini_IntSet(file, "Password",password2);
            dini_IntSet(file, "Level",PlayerInfo[playerid][Level]);
            dini_IntSet(file, "Money",PlayerInfo[playerid][Money]);
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Bun Venit",""ALB"Cont inregistrat cu succes!\n"ALB"Scrie parola ta mai jos pentru a te loga","Log-in","Quit");
        }
    }
    return 1;
}
Reply
#4

same problem
Reply
#5

it wont create the folder, you have to make it yourself, it will make .ini and .txt tho, just create a file named
Accounts and it should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)