mysql login
#1

Hey, sometimes when i login nothing happends i dont know why..

pawn Код:
//-------------------------------[Login]--------------------------------------------------------------------------
    if (strcmp(cmd, "/login", true) ==0 )
    {
        new tmppass[64];
        GetPlayerName(playerid, playername, 26);
        if (gPlayerLogged[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /login [password]");
            return 1;
        }
        if(MySQLCheckAccount(playername)==0)
        {
          SendClientMessage(playerid, COLOR_WHITE, "SERVER: You dont own an account.");
          return 1;
        }
        strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
        Encript(tmppass);
        if (gdebug){printf("DEBUG enterd %s", tmppass);}
        OnPlayerLogin(playerid,tmppass);
        return 1;
    }
pawn Код:
//-------------------------------[OnPlayerLogin]--------------------------------------------------------------------------
public OnPlayerLogin(playerid,const string[])
{
    if (gdebug >= 1){printf("DEBUG OnPlayerLogin(%d) (%s)", playerid,string);}
    new string2[64];
    new string3[64];
    new tmp2[128];
    new playername2[26];
    GetPlayerName(playerid, playername2, 26);
    MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "password", PlayerInfo[playerid][pPassword]);
    if(strcmp(PlayerInfo[playerid][pPassword],string, true ) == 0 )
    {
        new Data[1024];
        new Field[64];
        new rcnt = 1;
        MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
        samp_mysql_strtok(Field, "|", Data);
        while (samp_mysql_strtok(Field, "|", "")==1)
        {
            if(rcnt == 1) PlayerInfo[playerid][pAdmin] = strval(Field);
            if(rcnt == 4) PlayerInfo[playerid][pLevel] = strval(Field);
            if(rcnt == 5) PlayerInfo[playerid][pExp] = strval(Field);
            if(rcnt == 6) PlayerInfo[playerid][pDrugs] = strval(Field);
            if(rcnt == 7) PlayerInfo[playerid][pCash] = strval(Field);
            if(rcnt == 8) PlayerInfo[playerid][pAccount] = strval(Field);
            if(rcnt == 9) PlayerInfo[playerid][pJRank] = strval(Field);
            if(rcnt == 10) PlayerInfo[playerid][pModel] = strval(Field);
            if(rcnt == 12) PlayerInfo[playerid][pRank] = strval(Field);
            if(rcnt == 13) PlayerInfo[playerid][pTeam] = strval(Field);
            if(rcnt == 14) PlayerInfo[playerid][gPupgrade] = strval(Field);
            if(rcnt == 15) PlayerInfo[playerid][pKills] = strval(Field);
            if(rcnt == 16) PlayerInfo[playerid][pCB] = strval(Field);
            if(rcnt == 17) PlayerInfo[playerid][pHW] = strval(Field);
            if(rcnt == 18) PlayerInfo[playerid][pSR] = strval(Field);
            if(rcnt == 19) PlayerInfo[playerid][pWA] = strval(Field);
            if(rcnt == 20) PlayerInfo[playerid][pPEN] = strval(Field);
            if(rcnt == 21) PlayerInfo[playerid][pGun1] = strval(Field);
            if(rcnt == 22) PlayerInfo[playerid][pGun2] = strval(Field);
            if(rcnt == 23) PlayerInfo[playerid][pGun3] = strval(Field);
            if(rcnt == 24) PlayerInfo[playerid][pGun4] = strval(Field);
            if(rcnt == 25) PlayerInfo[playerid][pGun5] = strval(Field);
            if(rcnt == 26) PlayerInfo[playerid][pGun6] = strval(Field);
            if(rcnt == 27) PlayerInfo[playerid][pGun7] = strval(Field);
            if(rcnt == 28) PlayerInfo[playerid][pAmmo1] = strval(Field);
            if(rcnt == 29) PlayerInfo[playerid][pAmmo2] = strval(Field);
            if(rcnt == 30) PlayerInfo[playerid][pAmmo3] = strval(Field);
            if(rcnt == 31) PlayerInfo[playerid][pAmmo4] = strval(Field);
            if(rcnt == 32) PlayerInfo[playerid][pAmmo5] = strval(Field);
            if(rcnt == 33) PlayerInfo[playerid][pAmmo6] = strval(Field);
            if(rcnt == 34) PlayerInfo[playerid][pAmmo7] = strval(Field);
            if(rcnt == 35) PlayerInfo[playerid][pSHealth] = strval(Field);
            if(rcnt == 36) PlayerInfo[playerid][pLicenseA] = strval(Field);
            if(rcnt == 37) PlayerInfo[playerid][pLicenseB] = strval(Field);
            if(rcnt == 38) PlayerInfo[playerid][pLicenseC] = strval(Field);
            if(rcnt == 39) PlayerInfo[playerid][pInt] = strval(Field);
            if(rcnt == 40) PlayerInfo[playerid][pLocal] = strval(Field);
            if(rcnt == 41) PlayerInfo[playerid][pPnumber] = strval(Field);
            if(rcnt == 42) PlayerInfo[playerid][pPhousekey] = strval(Field);
            if(rcnt == 43) PlayerInfo[playerid][pPbiskey] = strval(Field);
            if(rcnt == 44) PlayerInfo[playerid][pDuty] = strval(Field);
            if(rcnt == 45) PlayerInfo[playerid][pWarnL] = strval(Field);
            if(rcnt == 46) PlayerInfo[playerid][pSArmour] = strval(Field);
            if(rcnt == 47) PlayerInfo[playerid][pJailed] = strval(Field);
            if(rcnt == 48) PlayerInfo[playerid][pStored] = strval(Field);
            if(rcnt == 49) PlayerInfo[playerid][pIP] = strval(Field);
            rcnt++;
        }
        samp_mysql_free_result();
    }
    else
    {
      SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password does not match your name");
      return 1;
    }
Reply
#2

What gamemode are you using?
Reply
#3

im 99% sure hes using moderntopia.
Reply
#4

my own, why ? i just need help fixing this problem :P but its a sort of moderntopia ( the mysql shit ) and a heavy modefied PEN script
Reply
#5

someone knows the solution?
Reply
#6

[center][b]gamemode is properly connected to the mysql database?
Reply
#7

Quote:
Originally Posted by ™ScorpioN
[center][b]gamemode is properly connected to the mysql database?
yes else the server would crash i check the connection before i start a query so.. :P
Reply
#8

[b]what does? "password doesnt match your name" or apsolutly nothing..?

sorry for my bad english
Reply
#9

Quote:
Originally Posted by ™ScorpioN
[b]what does? "password doesnt match your name" or apsolutly nothing..?

sorry for my bad english
It means the password he wrote doesn't have match to the player name.
Reply
#10

Quote:
Originally Posted by ™ScorpioN
[b]what does? "password doesnt match your name" or apsolutly nothing..?

sorry for my bad english
he does nothing he only stands there and do shit.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)