[MYSQL]Problema
#1

Bueno pues estaban insertando en mi GM mysql y tal pero a surgido un fallo y esque en el login, si tu fallas la pass va bien, te da el aviso y tal pero si pones la pass bien crashea el Samp-Server.

Aqui os dejo la parte de OnPlayerLogin de Mysql:

pawn Код:
MySQLCheckConnection();
    new tmp2[256];
  new string2[64];
    new playername2[MAX_PLAYER_NAME];
    new playernamesplit[3][MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername2, sizeof(playername2));
    split(playername2, playernamesplit, '_');
    MySQLFetchAcctSingle(PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
    if(strcmp(PlayerInfo[playerid][pKey],Password, 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)
        {
            // The rcnt values here represent the order of the columns in the characters table, so don't mess with them
            // If you add a column to the table, just add a new line with a +1 rcnt to the block below
            // Start it at 3 to skip the first few records we don't need (id, player name, password)
            if (rcnt == 3) PlayerInfo[playerid][pLevel] = strval(Field);
            if (rcnt == 4) PlayerInfo[playerid][pAdmin] = strval(Field);
            if (rcnt == 5) PlayerInfo[playerid][pDonateRank] = strval(Field);
            if (rcnt == 6) PlayerInfo[playerid][gPupgrade] = strval(Field);
            if (rcnt == 7) PlayerInfo[playerid][pConnectTime] = strval(Field);
            if (rcnt == 8) PlayerInfo[playerid][pReg] = strval(Field);
            if (rcnt == 9) PlayerInfo[playerid][pSex] = strval(Field);
            if (rcnt == 10) PlayerInfo[playerid][pAge] = strval(Field);
            if (rcnt == 11) PlayerInfo[playerid][pOrigin] = strval(Field);
            if (rcnt == 12) PlayerInfo[playerid][pCK] = strval(Field);
            if (rcnt == 13) PlayerInfo[playerid][pMuted] = strval(Field);
            if (rcnt == 14) PlayerInfo[playerid][pExp] = strval(Field);
            if (rcnt == 15) PlayerInfo[playerid][pCash] = strval(Field);
            if (rcnt == 16) PlayerInfo[playerid][pAccount] = strval(Field);
            if (rcnt == 17) PlayerInfo[playerid][pCrimes] = strval(Field);
            if (rcnt == 18) PlayerInfo[playerid][pKills] = strval(Field);
            if (rcnt == 19) PlayerInfo[playerid][pDeaths] = strval(Field);
            if (rcnt == 20) PlayerInfo[playerid][pArrested] = strval(Field);
            if (rcnt == 21) PlayerInfo[playerid][pWantedDeaths] = strval(Field);
            if (rcnt == 22) PlayerInfo[playerid][pPhoneBook] = strval(Field);
            if (rcnt == 23) PlayerInfo[playerid][pLottoNr] = strval(Field);
            if (rcnt == 24) PlayerInfo[playerid][pFishes] = strval(Field);
            if (rcnt == 25) PlayerInfo[playerid][pBiggestFish] = strval(Field);
            if (rcnt == 26) PlayerInfo[playerid][pJob] = strval(Field);
            if (rcnt == 27) PlayerInfo[playerid][pPayCheck] = strval(Field);
            if (rcnt == 28) PlayerInfo[playerid][pHeadValue] = strval(Field);
            if (rcnt == 29) PlayerInfo[playerid][pJailed] = strval(Field);
            if (rcnt == 30) PlayerInfo[playerid][pJailTime] = strval(Field);
            if (rcnt == 31) PlayerInfo[playerid][pMats] = strval(Field);
            if (rcnt == 32) PlayerInfo[playerid][pDrugs] = strval(Field);
            if (rcnt == 33) PlayerInfo[playerid][pLeader] = strval(Field);
            if (rcnt == 34) PlayerInfo[playerid][pMember] = strval(Field);
            if (rcnt == 35) PlayerInfo[playerid][pFMember] = strval(Field);
            if (rcnt == 36) PlayerInfo[playerid][pRank] = strval(Field);
            if (rcnt == 37) PlayerInfo[playerid][pChar] = strval(Field);
            if (rcnt == 38) PlayerInfo[playerid][pContractTime] = strval(Field);
            if (rcnt == 39) PlayerInfo[playerid][pDetSkill] = strval(Field);
            if (rcnt == 40) PlayerInfo[playerid][pSexSkill] = strval(Field);
            if (rcnt == 41) PlayerInfo[playerid][pBoxSkill] = strval(Field);
            if (rcnt == 42) PlayerInfo[playerid][pLawSkill] = strval(Field);
            if (rcnt == 43) PlayerInfo[playerid][pMechSkill] = strval(Field);
            if (rcnt == 44) PlayerInfo[playerid][pJackSkill] = strval(Field);
            if (rcnt == 45) PlayerInfo[playerid][pCarSkill] = strval(Field);
            if (rcnt == 46) PlayerInfo[playerid][pNewsSkill] = strval(Field);
            if (rcnt == 47) PlayerInfo[playerid][pDrugsSkill] = strval(Field);
            if (rcnt == 48) PlayerInfo[playerid][pCookSkill] = strval(Field);
            if (rcnt == 49) PlayerInfo[playerid][pFishSkill] = strval(Field);
            if (rcnt == 50) PlayerInfo[playerid][pSHealth] = floatstr(Field);
            if (rcnt == 51) PlayerInfo[playerid][pHealth] = floatstr(Field);
            if (rcnt == 52) PlayerInfo[playerid][pInt] = strval(Field);
            if (rcnt == 53) PlayerInfo[playerid][pLocal] = strval(Field);
            if (rcnt == 54) PlayerInfo[playerid][pTeam] = strval(Field);
            if (rcnt == 55) PlayerInfo[playerid][pModel] = strval(Field);
            if (rcnt == 56) PlayerInfo[playerid][pPnumber] = strval(Field);
            if (rcnt == 57) PlayerInfo[playerid][pPcarkey] = strval(Field);
            if (rcnt == 58) PlayerInfo[playerid][pPhousekey] = strval(Field);
            if (rcnt == 59) PlayerInfo[playerid][pPbiskey] = strval(Field);
            if (rcnt == 60) PlayerInfo[playerid][pPos_x] = floatstr(Field);
            if (rcnt == 61) PlayerInfo[playerid][pPos_y] = floatstr(Field);
            if (rcnt == 62) PlayerInfo[playerid][pPos_z] = floatstr(Field);
            if (rcnt == 63) PlayerInfo[playerid][pCarLic] = strval(Field);
            if (rcnt == 64) PlayerInfo[playerid][pFlyLic] = strval(Field);
            if (rcnt == 65) PlayerInfo[playerid][pBoatLic] = strval(Field);
            if (rcnt == 66) PlayerInfo[playerid][pFishLic] = strval(Field);
            if (rcnt == 67) PlayerInfo[playerid][pGunLic] = strval(Field);
            if (rcnt == 68) PlayerInfo[playerid][pGun1] = strval(Field);
            if (rcnt == 69) PlayerInfo[playerid][pGun2] = strval(Field);
            if (rcnt == 70) PlayerInfo[playerid][pGun3] = strval(Field);
            if (rcnt == 71) PlayerInfo[playerid][pGun4] = strval(Field);
            if (rcnt == 72) PlayerInfo[playerid][pAmmo1] = strval(Field);
            if (rcnt == 73) PlayerInfo[playerid][pAmmo2] = strval(Field);
            if (rcnt == 74) PlayerInfo[playerid][pAmmo3] = strval(Field);
            if (rcnt == 75) PlayerInfo[playerid][pAmmo4] = strval(Field);
            if (rcnt == 76) PlayerInfo[playerid][pCarTime] = strval(Field);
            if (rcnt == 77) PlayerInfo[playerid][pPayDay] = strval(Field);
            if (rcnt == 78) PlayerInfo[playerid][pPayDayHad] = strval(Field);
            if (rcnt == 79) PlayerInfo[playerid][pWatch] = strval(Field);
            if (rcnt == 80) PlayerInfo[playerid][pWins] = strval(Field);
            if (rcnt == 81) PlayerInfo[playerid][pLoses] = strval(Field);
            if (rcnt == 82) PlayerInfo[playerid][pAlcoholPerk] = strval(Field);
            if (rcnt == 83) PlayerInfo[playerid][pDrugPerk] = strval(Field);
            if (rcnt == 84) PlayerInfo[playerid][pMiserPerk] = strval(Field);
            if (rcnt == 85) PlayerInfo[playerid][pPainPerk] = strval(Field);
            if (rcnt == 86) PlayerInfo[playerid][pTraderPerk] = strval(Field);
            if (rcnt == 87) PlayerInfo[playerid][pTut] = strval(Field);
            if (rcnt == 88) PlayerInfo[playerid][pMissionNr] = strval(Field);
            if (rcnt == 89) PlayerInfo[playerid][pWarns] = strval(Field);
            if (rcnt == 90) PlayerInfo[playerid][pVirWorld] = strval(Field);
            if (rcnt == 91) PlayerInfo[playerid][pFuel] = strval(Field);
            if (rcnt == 92) PlayerInfo[playerid][pMarried] = strval(Field);
            if (rcnt == 93) PlayerInfo[playerid][pMarriedTo] = strmid(PlayerInfo[playerid][pMarriedTo], Field, 0, strlen(Field)-1, 255);
            if (rcnt == 94)PlayerInfo[playerid][pFishTool]= strval(Field);
      if (rcnt == 95)PlayerInfo[playerid][pNote1]= strval(Field);
      if (rcnt == 96)PlayerInfo[playerid][pNote1s]= strval(Field);
      if (rcnt == 97)PlayerInfo[playerid][pNote2]= strval(Field);
      if (rcnt == 98)PlayerInfo[playerid][pNote2s]= strval(Field);
      if (rcnt == 99)PlayerInfo[playerid][pNote3]= strval(Field);
      if (rcnt == 100)PlayerInfo[playerid][pNote3s]= strval(Field);
      if (rcnt == 101)PlayerInfo[playerid][pNote4]= strval(Field);
      if (rcnt == 102)PlayerInfo[playerid][pNote4s]= strval(Field);
      if (rcnt == 103)PlayerInfo[playerid][pNote5]= strval(Field);
      if (rcnt == 104)PlayerInfo[playerid][pNote5s]= strval(Field);
      if (rcnt == 105)PlayerInfo[playerid][pInvWeapon]= strval(Field);
      if (rcnt == 106)PlayerInfo[playerid][pInvAmmo]= strval(Field);
      if (rcnt == 107)PlayerInfo[playerid][pLighter]= strval(Field);
      if (rcnt == 108)PlayerInfo[playerid][pCigarettes]= strval(Field);
            if (rcnt == 109) PlayerInfo[playerid][pLocked] = strval(Field);
            if (rcnt == 110) PlayerInfo[playerid][pFS] = strval(Field);
            if (rcnt == 111) PlayerInfo[playerid][pAmmuTrainTime] = strval(Field);
            if (rcnt == 112) PlayerInfo[playerid][pPistSkill] = strval(Field);
            if (rcnt == 113) PlayerInfo[playerid][pSilenSkill] = strval(Field);
            if (rcnt == 114) PlayerInfo[playerid][pDesertSkill] = strval(Field);
            if (rcnt == 115) PlayerInfo[playerid][pShotgSkill] = strval(Field);
            if (rcnt == 116) PlayerInfo[playerid][pSawnSkill] = strval(Field);
      if (rcnt == 117) PlayerInfo[playerid][pCombSkill] = strval(Field);
      if (rcnt == 118) PlayerInfo[playerid][pUziSkill] = strval(Field);
      if (rcnt == 119) PlayerInfo[playerid][pSmgSkill] = strval(Field);
      if (rcnt == 120) PlayerInfo[playerid][pAkSkill] = strval(Field);
      if (rcnt == 121) PlayerInfo[playerid][pM4Skill] = strval(Field);
      if (rcnt == 122) PlayerInfo[playerid][pPasaporte] = strval(Field);
            rcnt++;
        }
        samp_mysql_free_result();
    }
    else
    {
            SendClientMessage(playerid, COLOR_WHITE, "Servidor:La contraseсa no es correcta.");
        //fclose(UserFile);
        gPlayerLogTries[playerid] += 1;
        if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
        return 1;
    }
Gracias de Antemano
Reply
#2

Quote:

samp_mysql_free_result();

esto hace que crashee necesitas otra version de mysql otro plugin.
Reply
#3

Te recomiendo que no uses mysql, es mucho mejor y mбs rбpido leer de archivos de texto...

El mysql, tiene el inconveniente de tener que instalar un servidor web para poder ejecutar el server...

Asi que te recomiendo una libreria o include que lee desde archivos de texto...

Creo recordar que con dini se podнa...

Saludos y suerte
Reply
#4

Quote:
Originally Posted by wylly
Te recomiendo que no uses mysql, es mucho mejor y mбs rбpido leer de archivos de texto...

El mysql, tiene el inconveniente de tener que instalar un servidor web para poder ejecutar el server...

Asi que te recomiendo una libreria o include que lee desde archivos de texto...

Creo recordar que con dini se podнa...

Saludos y suerte
El necesita mysql, ya que harбn un PCU entonces es indispensable tener mysql..

Tengo un problema similar ojalб que alguien pueda darnos una solucion
Reply
#5

Quote:
Originally Posted by wylly
Te recomiendo que no uses mysql, es mucho mejor y mбs rбpido leer de archivos de texto...

El mysql, tiene el inconveniente de tener que instalar un servidor web para poder ejecutar el server...

Asi que te recomiendo una libreria o include que lee desde archivos de texto...

Creo recordar que con dini se podнa...

Saludos y suerte
diciento, prefiero una db a archivos, ya q es mas facil acceder a los datos de una db que mirando archivo por archivo
pero son preferencias
Reply
#6

Si usas, MySQL usa linux, es muy estable.
Reply
#7

їQue plugin estas utilizando Gw-platinum?
Reply
#8

Me pasa exactamente lo mismo, tengo mi GM en MYSQL y las tablas echas pero al loguear se crashea el sa-mp server y tambien pasa de lo que cuando me equivoco de pass tira la advertencia pero al loguear con la buena pass en el log tira esto y se cierra el sa-mp server

[10:22:16] 0: 0*Kurt_Drinsh*0.4
Reply
#9

Quote:
Originally Posted by SAWC™
їQue plugin estas utilizando?
Reply
#10

SA-MP MySQL v0.15, ese tengo

Especificamente este link: http://forum.sa-mp.com/index.php?topic=23931.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)