Account Save/Load
#3

pawn Code:
public OnPlayerLogin(playerid,password[])
{
    new tmp2[256]
    new string2[64];
    new string[128];
    new playername2[MAX_PLAYER_NAME];
    new playersip[24];

    SetRealName(playerid);
    GetPlayerName(playerid, playername2, sizeof(playername2));
    GetPlayerIp(playerid, playersip, sizeof(playersip));

    format(string2, sizeof(string2), "ERP/Users/%s.ini", playername2);

    if (fexist(string2))
    {
        new password2 = num_hash(password);
        if(INI_Int(string2,"Password") == password2)
        {
            PlayerInfo[playerid][pKey] = INI_Int(string2,"Password");
            PlayerInfo[playerid][pLevel] = INI_Int(string2,"Level");
            PlayerInfo[playerid][pSpawn] = INI_Int(string2,"Spawn");
        }
        else
        {
            gPlayerLogTries[playerid] += 1;
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,"Try Again, please Log-In","You have entered an incorrect password\nType your password below to log-in","Log-in","Quit");
            if(gPlayerLogTries[playerid] == 3) { Kick(playerid); }
        }
     }//missed this
     return 1;// return value is supposed to be below the bracket above
}//and you missed this too
Reply


Messages In This Thread
Account Save/Load - by ***Niko*** - 25.11.2013, 01:12
Re: Account Save/Load - by VenomXNL - 25.11.2013, 03:31
Re: Account Save/Load - by Sublime - 25.11.2013, 03:37
Re: Account Save/Load - by ***Niko*** - 25.11.2013, 09:44
Re: Account Save/Load - by ***Niko*** - 25.11.2013, 15:26
Re: Account Save/Load - by VenomXNL - 25.11.2013, 16:56
Re: Account Save/Load - by VenomXNL - 25.11.2013, 17:06
Re: Account Save/Load - by ***Niko*** - 25.11.2013, 17:09
Re: Account Save/Load - by VenomXNL - 25.11.2013, 17:14

Forum Jump:


Users browsing this thread: 1 Guest(s)