Mysql Errorid 1064
#10

pawn Code:
public LoginPlayer(playerid,password)
{
    mysql_store_result(gConnectionHandle);
    if(mysql_retrieve_row(gConnectionHandle) == 1)
    {
        mysql_fetch_field_row(mysqlstring, "Money"); GivePlayerMoney(playerid,strval(mysqlstring));
        mysql_fetch_field_row(mysqlstring, "Score"); SetPlayerScore(playerid,strval(mysqlstring));
        mysql_fetch_field_row(mysqlstring, "Admin"); PlayerInfo[playerid][pAdmin] = strval(mysqlstring);
        mysql_fetch_field_row(mysqlstring, "Kills"); PlayerInfo[playerid][pKills] = strval(mysqlstring);
        mysql_fetch_field_row(mysqlstring, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(mysqlstring);
        SendClientMessage(playerid,-1,"Succesfull Logged IN!");
        mysql_free_result(gConnectionHandle);
    }
    else
    {
        mysql_free_result(gConnectionHandle);
        SetPVarInt(playerid,"WrongPassword", GetPVarInt(playerid , "WrongPassword") + 1);
        if(GetPVarInt(playerid,"WrongPassword")==3)
        {
            SendClientMessage(playerid,-1,"Kicked From Server , Reason : Failed Logins !");
            return Kick(playerid);
        }
        format(mysqlstring,sizeof (mysqlstring),"Welcome %s /n Type your password below to Login on your CnR Account!",GetName(playerid));
        ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_PASSWORD, "Login on your CnR Account!",mysqlstring,"OK","Cancel");
        SendClientMessage(playerid,-1,"Wrong Password!");
    }
    return 1;
}
Try this code.
There is no need to check how much rows it has, you could simple fix this to add 'LIMIT 1' after your login query.
Also i have added 'gConnectionHandle' to all the mysql function, maybe this causes the crash.
Reply


Messages In This Thread
Mysql Errorid 1064 - by Admigo - 18.02.2013, 17:57
Re: Mysql Errorid 1064 - by Gamer_Z - 18.02.2013, 18:03
Re: Mysql Errorid 1064 - by Shaneisace - 18.02.2013, 18:04
Re: Mysql Errorid 1064 - by Admigo - 18.02.2013, 18:18
Re: Mysql Errorid 1064 - by Vince - 18.02.2013, 20:17
Re: Mysql Errorid 1064 - by Shaneisace - 19.02.2013, 02:26
Re: Mysql Errorid 1064 - by 3ventic - 19.02.2013, 09:03
Re: Mysql Errorid 1064 - by Admigo - 19.02.2013, 17:46
Re: Mysql Errorid 1064 - by Gamer_Z - 19.02.2013, 20:35
Re: Mysql Errorid 1064 - by BlackBank - 19.02.2013, 20:52

Forum Jump:


Users browsing this thread: 3 Guest(s)