Lots of errors on SQLite..
#3

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 

    switch (
dialogid
    { 
        case 
DIALOG_REGISTER
        { 
            if(!
response) return Kick(playerid); 
             
            if(!(
<= strlen(inputtext) <= 20)) 
            { 
                
SendClientMessage(playerid,0xFFFFFFFF"{33CCCC}DreamLand:{FFFFFF} Your password has to be between 5-20 characters"); 
                
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD"Register""Welcome to DreamLand!\n\nType your password below to register your account:""Register""Cancel"); 
                return 
1
            } 
             
            new 
                
q[208]; 
                 
            
WP_Hash(User[playerid][P_PASSWORD], 129inputtext); 
            
format(qsizeof(q),"INSERT INTO Accounts (username, password) VALUES ('%q', '%s')",User[playerid][P_NAME], User[playerid][P_PASSWORD]); 
            
db_query(Databaseq); 
             
            
SendClientMessage(playerid, -1"{33CCCC}DreamLand:{FFFFFF} Thank you for registering on the server! It means a lot to us!"); 
            
PlayerPlaySound(playerid,1057,0.0,0.0,0.0); 
             
            new 
                
DBResultResult
                 
            
Result db_query(Database"SELECT last_insert_rowid()"); 
            
User[playerid][P_ID] = db_get_field_assoc_int(Result); //Line 135
             
            
db_free_result(Result); 
        } 
        case 
DIALOG_LOGIN
        { 
            if(!
response) return Kick(playerid); 
             
            new 
                
buf[129]; 
                 
            
WP_Hash(buf129inputtext); 
             
            if(
strcmp(bufUser[playerid][P_PASSWORD])) 
            { 
                
SendClientMessage(playerid, -1"{33CCCC}DreamLand:{FFFFFF} Incorrect password, try again!"); 
                
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Welcome back!\n\nType your password below to login with your account:""Login""Cancel"); 
                return 
1
            } 
             
            new 
                
DBResultResult
                 
            
format(bufsizeof(buf), "SELECT * FROM Accounts WHERE username = '%q' LIMIT 1"User[playerid][P_NAME]); 
            
Result db_query(Databasebuf); 
             
            if(
db_num_rows(Result)) 
            { 
                
User[playerid][P_ID] = db_get_field_assoc_int(Result"userid"P_IDsizeof P_ID); //2 Errors on Line 163
                
User[playerid][P_RANK] = db_get_field_assoc_int(Result"admin"P_RANKsizeof P_RANK); //2 Errors on Line 164
                 
                
SendClientMessage(playerid, -1"{33CCCC}DreamLand:{FFFFFF} Welcome back and have fun!"); 
            } 
            
db_free_result(Result); 
        } 
        default: return 
0
    } 
    return 
1

Reply


Messages In This Thread
[SOLVED] Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 09:13
Re: Lots of errors on SQLite.. - by K0P - 19.06.2016, 09:20
Re: Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 09:24
Re: Lots of errors on SQLite.. - by SyS - 19.06.2016, 09:32
Re: Lots of errors on SQLite.. - by Konstantinos - 19.06.2016, 13:13
Re: Lots of errors on SQLite.. - by ChristolisTV - 19.06.2016, 16:04
Re: Lots of errors on SQLite.. - by SyS - 22.06.2016, 02:40

Forum Jump:


Users browsing this thread: 1 Guest(s)