error 035: argument type mismatch (argument 1)
#3

Alright so I managed to fix the error thanks to you.
And regardless of the error I changed the functions a little bit.
Now I don't get any errors, but I have encountered an issue in the script:

I type in the correct password, then it shows me the dialog where it says that the password I entered is incorrect, but then I can type in anything I want and it'll let me in. Of course only if I wrote the CORRECT password at first.

Example to make it easier:
Let's say that the real password is 74.
So I log in, type in "74" it says "Wrong password, please try again blah blah.." and then when I type again, I can type anything, like literally type in "wsuphomies" and it'll log me in.
The good thing is that at least, you have to type in the correct password at first, and only then you can type in whatever you want to log in.
But how can I fix it?

The current function:
PHP код:
        case 2// Login
        
{
            new 
name[MAX_PLAYER_NAME+1];
            
GetPlayerName(playeridnamesizeof(name));
            if(
CheckPassword(nameinputtext) >= 1)
            {
                
SendClientMessage(playeridCOLOR_WHITE"[SUCCESS] You have successfully logged in!");
                new 
string[128];
                
format(stringsizeof(string), "SELECT * FROM users WHERE username = '%s'"name);
                
mysql_function_query(dbHandlestringtrue"GetStats""d"playerid);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"[Error] Wrong password!");
                
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Login""Wrong password, enter the correct one!""Submit""Cancel");
            }
        } 
CheckPassword:
PHP код:
CheckPassword(name[], inputtext[])
{
    new 
rowsfieldsstring[128];
    
format(stringsizeof(string), "SELECT * FROM users WHERE username = '%s' AND password = '%s'"nameinputtext);
    
mysql_function_query(dbHandlestringtrue"""""");
    
cache_get_data(rowsfieldsdbHandle);
    if(
rows >= 1) return 1;
    else return 
0;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)