Can log in with any password [MySQL]
#8

Quote:
Originally Posted by Sawalha
View Post
Are you sure? be cause i use it in my saving system.
Can you show me the callback which you used to call player to check if he's registered or not,
like "OnAccountCheck" as many people use it.
Here ya' go:
pawn Code:
public OnAccountCheck(playerid)
{
    new str[200];
    new rows, fields;
    cache_get_data(rows, fields, mysql);
    if(rows)
    {
        cache_get_field_content(0, "PASS", pData[playerid][Password], mysql, 129);
        pData[playerid][ID] = cache_get_field_content_int(0, "ID");
        format(str, sizeof(str), "Welcome back to Reindience Roleplay, %s! \nLooks like your account is registered, please enter your password below:", GPName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_PASSWORD, "Welcome back to Reindience Roleplay!", str, "Login", "Quit");
    }
    else
    {
        format(str, sizeof(str), "Welcome to Reindience Roleplay, %s! \nLooks like your account is not registered, please enter a password below:", GPName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "Welcome to Reindience Roleplay!", str, "Register", "Quit");
    }
    return 1;
}
If any other code is needed, let me know.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)