Neon + MySQL
#1

I cannot login into my account ingame.
pawn Код:
if(dialogid == 1)
    {
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "You are not registered", "Type your password below", "Register"," ");
        new pname[24],ip[50],escname[24],Query[350],password[129];
        GetPlayerName(playerid, pname, sizeof(pname));
        mysql_real_escape_string(pname,escname);
        WP_Hash(password,129,inputtext);
        GetPlayerIp(playerid,ip,50);
        format(Query,300,"INSERT INTO `playerinfo` (`user`,`password`,`IP`,`kills`,`deaths`,`score`,`money`,`level`,`donor`) VALUES ('%s', '%s', '%s',0,0,0,0,0,0)",escname,password,ip);
        mysql_query(Query);
        SendClientMessage(playerid,limegreen,"You have successfully registered!");
        PInfo[playerid][Regged] = 1;
        PInfo[playerid][Logged] = 1;
    }

    else if(dialogid == 2)
    {
        new pname[24],Query[350],escname[24],password[129];
        GetPlayerName(playerid,pname,24);
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
        mysql_real_escape_string(pname,escname);
        WP_Hash(password,129,inputtext);
        format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' AND `password` = '%s'", escname, password);
        mysql_query(Query);
        mysql_store_result();
        if(!mysql_num_rows())
        {
            SendClientMessage(playerid,RED,"ERROR: Invalid Password!");
            SetPVarInt(playerid,"MaxFails",GetPVarInt(playerid,"MaxFails") +1);
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
            if(GetPVarInt(playerid,"MaxFails") == 3)
            {
                new string[128];
                format(string,128,"%s has been kicked for failing to login",pname);
                SendClientMessageToAll(RED,string);
                Kick(playerid);
            }
            mysql_free_result();
        }
        else
        {
            new line[800];
            if(mysql_fetch_row(line)) //Fetches the line
            {
                   new data[3][100]; //The data strings
                   new data2[6]; //The data variables
                   sscanf(line, "p|sssdddddd",data[0],data[1],data[2],data2[0],data2[1],data2[2],data2[3],data2[4],data2[5]); //Splits the line with sscanf
                   PInfo[playerid][Kills] = data2[0];
                   PInfo[playerid][Deaths] = data2[1];
                   SetPlayerScore(playerid, data2[2]);
                   PInfo[playerid][Score] = data2[2];
                   PInfo[playerid][Cash] = data2[3];
                   GivePlayerMoney(playerid,data2[3]);
                   SetPVarInt(playerid,"Level",data2[4]);
                   PInfo[playerid][VIP] = data2[5];
                   new loginstring[200];
                   format(loginstring,200,"You have logged in! [Admin Level: %d] [Donor Level: %d] [Kills: %d] [Deaths: %d] [Score: %d] [Cash: %d]",GetPVarInt(playerid,"Level"),PInfo[playerid][VIP],PInfo[playerid][Kills],PInfo[playerid][Deaths],PInfo[playerid][Score],PInfo[playerid][Cash]);
                   SendClientMessage(playerid,limegreen,loginstring);
                   mysql_free_result();
            }
        }
    }
I am using Whirlpool + StrickenKid's mysql plugin.

Thanks
~Snipa
Reply
#2

Try this and tell me if it works:
pawn Код:
else if(dialogid == 2)
    {
        new pname[24],Query[350],escname[24],buf[129], buf2[129];
        GetPlayerName(playerid,pname,24);
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
        mysql_real_escape_string(pname,escname);
        WP_Hash(buf,129,inputtext);
        format(Query, sizeof(Query), "SELECT * FROM `playerinfo` WHERE `user` = '%s' AND `password` = '%s'", escname, buf);
        mysql_query(Query);
        mysql_store_result();
        if(!mysql_num_rows())
        {
            SendClientMessage(playerid,RED,"ERROR: Invalid Password!");
            SetPVarInt(playerid,"MaxFails",GetPVarInt(playerid,"MaxFails") +1);
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
            if(GetPVarInt(playerid,"MaxFails") == 3)
            {
                new string[128];
                format(string,128,"%s has been kicked for failing to login",pname);
                SendClientMessageToAll(RED,string);
                Kick(playerid);
            }
            mysql_free_result();
        }
        else
        {
            new line[800];
            if(mysql_fetch_row(line)) //Fetches the line
            {
                   new data[3][100]; //The data strings
                   new data2[6]; //The data variables
                   sscanf(line, "p|sssdddddd",data[0],data[1],data[2],data2[0],data2[1],data2[2],data2[3],data2[4],data2[5]); //Splits the line with sscanf
                   PInfo[playerid][Kills] = data2[0];
                   PInfo[playerid][Deaths] = data2[1];
                   SetPlayerScore(playerid, data2[2]);
                   PInfo[playerid][Score] = data2[2];
                   PInfo[playerid][Cash] = data2[3];
                   GivePlayerMoney(playerid,data2[3]);
                   PInfo[playerid][Level] = data2[4];
                   PInfo[playerid][VIP] = data2[5];
                   new loginstring[200];
                   format(loginstring,200,"You have logged in! [Admin Level: %d] [Donor Level: %d] [Kills: %d] [Deaths: %d] [Score: %d] [Cash: %d]",PInfo[playerid][Level],PInfo[playerid][VIP],PInfo[playerid][Kills],PInfo[playerid][Deaths],PInfo[playerid][Score],PInfo[playerid][Cash]);
                   SendClientMessage(playerid,limegreen,loginstring);
                   mysql_free_result();
            }
        }
    }
Reply
#3

Nope, still says the same thing..

I'll post some logs:

PHP код:
[Thu Jun  2 20:26:04 2011] Function: mysql_real_esacpe_string executed"[BFV]Wolf[COD5]" with result"[BFV]Wolf[COD5]".
[
Thu Jun  2 20:26:04 2011] Function: mysql_query executed"SELECT * FROM `playerinfo` WHERE `user` = '[BFV]Wolf[COD5]'" with result"0".
[
Thu Jun  2 20:26:04 2011] Function: mysql_store_result executed with result"1"
[Thu Jun  2 20:26:04 2011] Function: mysql_num_rows executed with result"%".
[
Thu Jun  2 20:26:08 2011] Function: mysql_real_esacpe_string executed"[BFV]Wolf[COD5]" with result"[BFV]Wolf[COD5]".
[
Thu Jun  2 20:26:08 2011] Function: mysql_query executed"SELECT * FROM `playerinfo` WHERE `user` = '[BFV]Wolf[COD5]' AND `password` = '3C6AF0B572CD9A00E8D04BC4642F4ADAC4BBC705F26B9B29A6494AAA14D4E218A3A99E0B7BF7945E933DE9178EBD5253CB07A91BCBB2AF98B38E8C5CE5694F56'" with result"0".
[
Thu Jun  2 20:26:08 2011] Function: mysql_store_result executed with result"1"
[Thu Jun  2 20:26:08 2011] Function: mysql_num_rows executed with result"%".
[
Thu Jun  2 20:26:08 2011] Function: mysql_free_result executed.
[
Thu Jun  2 20:26:11 2011] Function: mysql_real_esacpe_string executed"[BFV]Wolf[COD5]" with result"[BFV]Wolf[COD5]".
[
Thu Jun  2 20:26:11 2011] Function: mysql_query executed"SELECT * FROM `playerinfo` WHERE `user` = '[BFV]Wolf[COD5]' AND `password` = 'B0F60D2B4D423F749B2990A4F8D99C206E8355FD4419C892474593CDEAE6724EDB661069E9751E7CCD90B20581F0DC1DBE16F87317E30A6236CD072E02765370'" with result"0".
[
Thu Jun  2 20:26:11 2011] Function: mysql_store_result executed with result"1"
[Thu Jun  2 20:26:11 2011] Function: mysql_num_rows executed with result"%".
[
Thu Jun  2 20:26:11 2011] Function: mysql_free_result executed.
[
Thu Jun  2 20:26:15 2011] Function: mysql_real_esacpe_string executed"[BFV]Wolf[COD5]" with result"[BFV]Wolf[COD5]".
[
Thu Jun  2 20:26:15 2011] Function: mysql_query executed"SELECT * FROM `playerinfo` WHERE `user` = '[BFV]Wolf[COD5]' AND `password` = '42917C6AD38B99A4BF0A616FBE025533B5FCE6397059FA7F67E8B891E06B189B2832E2786EF57DA05BE703B379446474FA0B1B8B536E9C7D6BD8DC91C4960D7D'" with result"0".
[
Thu Jun  2 20:26:15 2011] Function: mysql_store_result executed with result"1"
[Thu Jun  2 20:26:15 2011] Function: mysql_num_rows executed with result"%".
[
Thu Jun  2 20:26:15 2011] Function: mysql_free_result executed
Reply
#4

bump AGAIN..
Reply
#5

haha snipa your penis is smaller than mine
Reply
#6

Your hilarious.. I see how you get a higher postcount.

Now, can I actually get some help?
Reply
#7

bump again..
Reply
#8

FFS, nobody?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)