Database check (R41-2)
#1

Hello!
Decided to try the latest plugin version, made with the tutorial, but don't know what's wrong with the players table checking, so need some help with this.
Код:
public OnAccountCheck(playerid)
{
    new string[128];
    switch(orm_errno(pInfo[playerid][ORM_ID]))
    {
        case ERROR_INVALID:
        {
            printf("Invalid ORM id!");
        }
        case ERROR_NO_DATA:
        {
            printf("No data in the table!");
            format(string, sizeof(string), "{FFFFFF}Hello, %s!\n\nPlease type your password in the field below:", PlayerName(playerid));
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFFFF}Register", string, "Register", "Exit");
	}
    	case ERROR_OK:
	{
            printf("There is no error!");
            orm_addvar_string(pInfo[playerid][ORM_ID], pInfo[playerid][Password], 24, "Password");
            format(string, sizeof(string), "{FFFFFF}Hello, %s!\n\nPlease type your password in the field below:", PlayerName(playerid));
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFFFF}Login", string, "Login", "Exit");
	}
    }
    orm_setkey(pInfo[playerid][ORM_ID], "ID");
    return true;
}
It returns register dialog even if the player exists in database.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)