SQLite - Load function problem
#1

Hello everyone !
Recently I started to learn how SQLite work and I've tried to make a database using it, but I have some problems with the Load function

Here it's the code:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new DBResult:res,ip[16];
    GetPlayerIp(playerid,ip,sizeof(ip));
    switch(dialogid)
    {
        case 1: // Register
        {
            if(response)
            {
                format(str,sizeof(str),"SELECT * FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE AND `PASSWORD` = '%s'",Escape(GetName(playerid)),Escape(inputtext));
                res=db_query(users,str);
           /*if(db_num_rows(res))
                {
                    db_get_field_assoc(res,"LEVEL",field,30);
                    SetPlayerScore(playerid,strval(field));
                    SendClientMessage(playerid,0x000000ff,"You logged in !");
                }*/

                else ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Please enter your password","Login","Exit");
                db_free_result(res);
            }
            else return Kick(playerid);
        }
And I want to put this
pawn Код:
if(db_num_rows(res))
                {
                    db_get_field_assoc(res,"LEVEL",field,30);
                    SetPlayerScore(playerid,strval(field));
                    SendClientMessage(playerid,0x000000ff,"You logged in !");
                }
inside this function
pawn Код:
public Load(playerid)
{
    return 1;
}
Reply
#2

Nobody ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)