Server kicks me out, when I log in.
#1

Hi!

I've got a problem with my OnPlayerLogin.
I replaced the mysql_get_row with mysqlfetchacctsingle, because the mysql_get_row didn't work on my host and now, when I log in, it just kicks me out, saying "Server closed the connection."

Here's the pawn code:
pawn Code:
public OnPlayerLogin(playerid,password[]) // by Luk0r v1.0
{
    MySQLCheckConnection();
    printf("Check 1");
    new tmp2[256];
    new string2[64];
    new str[128];
    new
    string[256]
    ;
    new playername2[MAX_PLAYER_NAME];
    new playernamesplit[3][MAX_PLAYER_NAME];
    GetRPName(playerid, playername2, sizeof(playername2));
    split(playername2, playernamesplit, '_');
    MySQLFetchAcctSingle(KasutajaInfo[playerid][pSQLID], "Password", KasutajaInfo[playerid][pKey]);
    printf("Check 2");
    if(!strcmp(KasutajaInfo[playerid][pKey],password, true ) )
    {
        new Query[1024];
        new Field[64];
        new result[256];
        printf("Check 3");
        format(Query, sizeof(Query), "SELECT * FROM `players` WHERE `id` = '%d'", KasutajaInfo[playerid][pSQLID] );
        mysql_query(Query);
        mysql_store_result();
        printf("Check 4");
        if(mysql_fetch_row_format(Query,"|"))
        {
            printf("Check 5");
            MySQLFetchAcctSingle(KasutajaInfo[playerid][pSQLID], "PlayerLevel", KasutajaInfo[playerid][pLevel]);
                    // A couple of more lines, about a hundred. :D
Reply
#2

Code:
    if(!strcmp(KasutajaInfo[playerid][pKey],password, true ) )
Try to replace this code with:

Code:
    if(strcmp(KasutajaInfo[playerid][pKey],password, true ) )
Reply
#3

That's not the problem. Because the lines, that u don't see, are else SendClientMessage...
Reply
#4

Bump<1
Reply
#5

@Tsonn1, the code he posted should be right

pawn Code:
if(strcmp(KasutajaInfo[playerid][pKey],password, true ) )
If you had a !, you're basically stating that if it has the wrong password, it can get out of here. Have you tried it?
Reply
#6

Quote:
Originally Posted by jotan.
View Post
Code:
    if(!strcmp(KasutajaInfo[playerid][pKey],password, true ) )
Try to replace this code with:

Code:
    if(strcmp(KasutajaInfo[playerid][pKey],password, true ) )
Quote:
Originally Posted by KiNG3
View Post
@Tsonn1, the code he posted should be right

pawn Code:
if(strcmp(KasutajaInfo[playerid][pKey],password, true ) )
If you had a !, you're basically stating that if it has the wrong password, it can get out of here. Have you tried it?
Don't post if you don't know what you're talking about.

strcmp() returns 0 if the strings MATCH. So you are both wrong. The original post strcmp line is correct.
Reply
#7

Quote:
Originally Posted by KiNG3
View Post
@Tsonn1, the code he posted should be right

pawn Code:
if(strcmp(KasutajaInfo[playerid][pKey],password, true ) )
If you had a !, you're basically stating that if it has the wrong password, it can get out of here. Have you tried it?
No! strcmp return 0 if the 2 strings are equal. That line is correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)