Help with my login and register command. rep+
#1

pawn Код:
CMD:register(playerid,params[])
{
    if(IsLogged[playerid] == 0)
    {
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"data");
        INI_WriteInt(File,"Password",PlayerInfo[playerid][Password]);
        INI_WriteInt(File,"Score",0);
        INI_WriteInt(File,"Skin",0);
        INI_Close(File);
        SendClientMessage(playerid,COLOR_YELLOW,"You've successfully registered. (login with /login)");
    }
    else
    {
        SendClientMessage(playerid,COLOR_WHITE,"You're already registered. Please login with /login.");
    }
    return 1;
}
CMD:login(playerid,params[])
{
    if(PlayerInfo[playerid][Password])
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SendClientMessage(playerid,COLOR_WHITE,"You've successfully logged in.");
    }
    else
    {
        SendClientMessage(playerid,-1,EMBED_RED"WRONG PASSWORD!" EMBED_GREEN "Please attempt to re-login.");
    }
    return 1;
}
I do /register, it says i'v registered, but when I do /login it says wrong password, why? ( I'm trying to work with Y_INI a bit ) thanks in advance
Reply
#2

Where do you set? PlayerInfo[playerid][Password]
As shouldn't it be the params instead of the stored version, as nothing will be stored until login?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)