SA-MP Forums Archive
[SOLVED]Help - Accounts registered not saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [SOLVED]Help - Accounts registered not saving (/showthread.php?tid=317279)



[SOLVED]Help - Accounts registered not saving - John Rockie - 10.02.2012

Well. I have a problem where I go in the server, create an account but it wont save. I doesn't appear in the scriptfiles and its asking me to register everytime i enter there server

This is the registration code:
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);
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
                strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
                new var[64];
                format(var, 64, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
                PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
                format(var, 64, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
                format(var, 64, "Admin=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
                format(var, 64, "Reg=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
                format(var, 64, "Cash=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
                format(var, 64, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
                format(var, 64, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
                format(var, 64, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
                format(var, 64, "Donator=%d\n",PlayerInfo[playerid][pDonator]);fwrite(hFile, var);
                format(var, 64, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
                format(var, 64, "Warns=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
                format(var, 64, "Locked=%d\n",PlayerInfo[playerid][pLocked]);fwrite(hFile, var);
                fclose(hFile);
                gPlayerAccount[playerid] = 1;
                /////////// REGISTER DIALOG ///////////////
                new Dialog1[256];
                new pName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pName, sizeof(pName));
                format(Dialog1,256,"Welcome to WW2!\nAccount: %s\nType here password:",pName);
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login system",Dialog1,"Login","Quit");
                /////////// REGISTER DIALOG ///////////////
            }
    }
    return 1;
}
Do I need some kind of include or something?
This are the includes I have in the script.
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
Any help is appreciated.


Re: Help - Accounts registered not saving - Nonameman - 10.02.2012

Does 'accounts' folder exist in scriptfiles?


Re: Help - Accounts registered not saving - John Rockie - 10.02.2012

HAHA, I feel noob now. Thanks man.


Re: [SOLVED]Help - Accounts registered not saving - Nonameman - 10.02.2012

Sometimes it happens, don't worry. DD
Your welcome.


Re: [SOLVED]Help - Accounts registered not saving - Guest9328472398472 - 10.02.2012

Some scripts create the folder if it's not found, yours prob didn't.

At least it's all fixed now!