Account system don't work ...
#7

This would be more like it:

pawn Код:
public RegisterPlayer(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
        new name[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, name, sizeof name);
        format(str, sizeof str, "%s.ini", name);
        new File:account = fopen(str, io_write);
        if (account)
        {
            strmid(AccountInfo[playerid][aPassword], password, 0, strlen(password), 128);
            GetPlayerPos(playerid, AccountInfo[playerid][aX], AccountInfo[playerid][aY], AccountInfo[playerid][aZ]);
            GetPlayerFacingAngle(playerid, AccountInfo[playerid][aA]);

            new file[128];
            format(file, sizeof file, "Password: %s\n", AccountInfo[playerid][aPassword]); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "Cash: %d\n", 0); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "Score: %d\n", 0); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "X: %f\n",AccountInfo[playerid][aX]); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "Y: %f\n",AccountInfo[playerid][aY]); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "Z: %f\n",AccountInfo[playerid][aZ]); // Format
            fwrite(account, file); // Save

            format(file, sizeof file, "Angle: %f\n",AccountInfo[playerid][aA]); // Format
            fwrite(account, file); // Save

            fclose(account); // Close
            SendClientMessage(playerid, 0x21DD00FF, "You have successfully registered an account. You may now /login.");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Account system don't work ... - by Michael@Belgium - 05.01.2011, 14:42
Re: Account system don't work ... - by hanzen - 05.01.2011, 14:45
Re: Account system don't work ... - by Michael@Belgium - 05.01.2011, 15:13
Re: Account system don't work ... - by hanzen - 05.01.2011, 15:22
Re: Account system don't work ... - by Scenario - 05.01.2011, 15:23
Re: Account system don't work ... - by Michael@Belgium - 05.01.2011, 19:00
Re: Account system don't work ... - by Scenario - 05.01.2011, 19:53
Re: Account system don't work ... - by Michael@Belgium - 05.01.2011, 20:02

Forum Jump:


Users browsing this thread: 1 Guest(s)