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

What about this? I tested it briefly and it seems to work pretty fine, I'd still like to hear others' opinions.
PHP код:
        case 2// Login
        
{
            new 
name[MAX_PLAYER_NAME+1], string[128];
            
GetPlayerName(playeridnamesizeof(name));
            
//if(CheckPassword(name, inputtext) >= 1)
            
format(stringsizeof(string), "SELECT * FROM users WHERE username = '%s' AND password = '%s'"nameinputtext);
            
mysql_function_query(dbHandlestringtrue"CheckPassword""is"playeridname);

PHP код:
forward CheckPassword(playeridname[]);
public 
CheckPassword(playeridname[])
{
    new 
rowsfieldsstring[128];
    
cache_get_data(rowsfieldsdbHandle);
    if(
rows >= 1)
    {
        
SendClientMessage(playeridCOLOR_WHITE"[SUCCESS] You have successfully logged in!");
        
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");
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)