Y_ini Savin' Problem
#1

The file dosnt get created... (Unknown123.ini)
Why not?

pawn Код:
#define FILE_FOLDER "Accounts/%s.ini"

dcmd_register(playerid, params[])
{
    new password[128];
    if(sscanf(params, "s[128]", password)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /register (password)");
    {
        new PlayerFile[256];

        format(PlayerFile, sizeof PlayerFile, FILE_FOLDER, Encode(PlayerName(playerid)));

        new INI:PlayerAccount = INI_Open(PlayerFile);
        INI_WriteString(PlayerAccount, "Name", PlayerName(playerid));
        INI_WriteString(PlayerAccount, "Password", password);
        INI_WriteString(PlayerAccount, "PlayerIP", PlayerIP(playerid));
        INI_WriteInt(PlayerAccount, "AdminLevel", 0);
        INI_WriteInt(PlayerAccount, "Score", 0);
        INI_WriteInt(PlayerAccount, "Money", 0);
        INI_WriteInt(PlayerAccount, "Kills", 0);
        INI_WriteInt(PlayerAccount, "Deaths", 0);
        INI_Close(PlayerAccount);
       
        SendClientMessage(playerid, 0xFF0000FF, "Registred!");
        return 1;
    }
}
Reply
#2

pawn Код:
#define FILE_FOLDER "Accounts/%s.ini"

dcmd_register(playerid, params[])
{
    new password[128];
    if(sscanf(params, "s[128]", password)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /register (password)");
    new PlayerFile[ 13 + MAX_PLAYER_NAME ];
    format(PlayerFile, sizeof PlayerFile, FILE_FOLDER, Encode(PlayerName(playerid)));
    new INI:PlayerAccount = INI_Open(PlayerFile);
    INI_WriteString(PlayerAccount, "Name", PlayerName(playerid));
    INI_WriteString(PlayerAccount, "Password", password);
    INI_WriteString(PlayerAccount, "PlayerIP", PlayerIP(playerid));
    INI_WriteInt(PlayerAccount, "AdminLevel", 0);
    INI_WriteInt(PlayerAccount, "Score", 0);
    INI_WriteInt(PlayerAccount, "Money", 0);
    INI_WriteInt(PlayerAccount, "Kills", 0);
    INI_WriteInt(PlayerAccount, "Deaths", 0);
    INI_Close(PlayerAccount);
    SendClientMessage(playerid, 0xFF0000FF, "Registred!");
    return 1;
}
Reply
#3

Still not working =/

EDIT: Is it possible to Enable/Disable file writing? Because GarHouse is not saving too =/ it says the house is saved.. but nothing
Reply
#4

Make sure that you have "Accounts" folder in scriptfiles.
Reply
#5

Quote:
Originally Posted by Clive
Посмотреть сообщение
Make sure that you have "Accounts" folder in scriptfiles.
I have.

"scriptfiles/Accounts/(Accounts empty folder)"
Reply
#6

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
I have.

"scriptfiles/Accounts/(Accounts empty folder)"
I edited my post try that code again.
Reply
#7

Not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)