MySQL r37 account login problem
#1

Hello im having an issue with loading a players account.
it saves everything perfectly to the DB but then when you leave and then join again all variables are set too 0

Код:
public OnAccountLoad(playerid)
{
    PlayerInfo[playerid][pAdminLevel] = cache_get_field_content_int(0, "AdminLevel");
    TogglePlayerSpectating(playerid, false);
    SpawnPlayer(playerid);

    SendClientMessage(playerid, -1, "You have successfully logged in.");
    return 1;
}

public OnAccountCheck(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields, mysql);
    if(rows)
    {
        cache_get_field_content(0, "Password", PlayerInfo[playerid][Password], mysql, 129);
        ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_INPUT, "Login", "Welcome player!\nYour account has been found in our database. Please fill in your password:", "Login", "Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_INPUT, "Register", "Welcome player!\nYour account has not been registered yet. Please fill in your desired password:", "Register", "Quit");
    }
    return 1;
}
For example i set my selft as admin level 3, then leave it saves to the DB
i then log back into my account and my admin level is 0
Reply


Messages In This Thread
MySQL r37 account login problem - by legho - 23.12.2015, 12:26
Re: MySQL r37 account login problem - by TwinkiDaBoss - 23.12.2015, 13:21
Re: MySQL r37 account login problem - by legho - 23.12.2015, 13:28
Re: MySQL r37 account login problem - by Jimmy0wns - 23.12.2015, 13:31
Re: MySQL r37 account login problem - by legho - 23.12.2015, 13:33
Re: MySQL r37 account login problem - by Jimmy0wns - 23.12.2015, 13:38
Re: MySQL r37 account login problem - by legho - 23.12.2015, 13:46
Re: MySQL r37 account login problem - by TwinkiDaBoss - 23.12.2015, 15:24
Re: MySQL r37 account login problem - by legho - 23.12.2015, 15:49
Re: MySQL r37 account login problem - by legho - 23.12.2015, 15:54

Forum Jump:


Users browsing this thread: 2 Guest(s)