Szerző Téma: MySQL betöltés hiba  (Megtekintve 597 alkalommal)

Nem elérhető AnthonyGates

  • 546
  • AnthonyGates
    • Profil megtekintése
MySQL betöltés hiba
« Dátum: 2014. május 02. - 12:40:48 »
0 Show voters
Sziasztok! Letöltöttem egy alap RolePlay játékmódot, a saját tudásom fejlesztésére, és az ötleteim megvalósítására.
MySQL alapon mûködik, rendben is megy, betölt mindent. Kivétel a karakterek adatait.
Bejelentkeztetõ dialog:
 
  if(response)
        {
            new query[1000],escapepass[26];
        mysql_real_escape_string(inputtext, escapepass);
      format(query, sizeof(query), \"SELECT * FROM Accounts WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", pName(playerid), escapepass);
      mysql_query(query);
      mysql_store_result();
      if(mysql_num_rows() != 0)
       {
         if(mysql_fetch_row_format(query, \"|\"))
         {
            sscanf(query,\"p<|>ddddddddfffdddddddddddd\",
               PlayerInfo[playerid][Tutorial],
               PlayerInfo[playerid][Level],
               PlayerInfo[playerid][Cash],
               PlayerInfo[playerid][Admin],
               PlayerInfo[playerid][AdminPass],
               PlayerInfo[playerid][AdminLogged],
               PlayerInfo[playerid][AdminDuty],
               PlayerInfo[playerid][skin],
               PlayerInfo[playerid][Posx],
               PlayerInfo[playerid][Posy],
               PlayerInfo[playerid][Posz],
               PlayerInfo[playerid][VWorld],
               PlayerInfo[playerid][interior],
               PlayerInfo[playerid][Age],
               PlayerInfo[playerid][Gender],
               PlayerInfo[playerid][Kicks],
               PlayerInfo[playerid][banned],
               PlayerInfo[playerid][bans],
               PlayerInfo[playerid][Muted],
               PlayerInfo[playerid][Faction],
               PlayerInfo[playerid][Rank],
               PlayerInfo[playerid][Job],
               PlayerInfo[playerid][House]);
         }

 



 case DIALOG_LOGIN:
{
        if(!response){ SendClientMessage(playerid, COLOR_RED, \"You decided to quit from the server.\"); Kick(playerid);}
        if(response)
        {
            new query[1000],escapepass[26];
        mysql_real_escape_string(inputtext, escapepass);
      format(query, sizeof(query), \"SELECT * FROM Accounts WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", pName(playerid), escapepass);
      mysql_query(query);
      mysql_store_result();
      if(mysql_num_rows() != 0)
       {
         if(mysql_fetch_row_format(query, \"|\"))
         {
            sscanf(query,\"p<|>ddddddddfffdddddddddddd\",
               PlayerInfo[playerid][Tutorial],
               PlayerInfo[playerid][Level],
               PlayerInfo[playerid][Cash],
               PlayerInfo[playerid][Admin],
               PlayerInfo[playerid][AdminPass],
               PlayerInfo[playerid][AdminLogged],
               PlayerInfo[playerid][AdminDuty],
               PlayerInfo[playerid][skin],
               PlayerInfo[playerid][Posx],
               PlayerInfo[playerid][Posy],
               PlayerInfo[playerid][Posz],
               PlayerInfo[playerid][VWorld],
               PlayerInfo[playerid][interior],
               PlayerInfo[playerid][Age],
               PlayerInfo[playerid][Gender],
               PlayerInfo[playerid][Kicks],
               PlayerInfo[playerid][banned],
               PlayerInfo[playerid][bans],
               PlayerInfo[playerid][Muted],
               PlayerInfo[playerid][Faction],
               PlayerInfo[playerid][Rank],
               PlayerInfo[playerid][Job],
               PlayerInfo[playerid][House]);
         }
         else
         {
             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Login\", \"Incorrect Password: Input your password\", \"Login\", \"Cancel\");
         }
                if(PlayerInfo[playerid][Tutorial] <= 3)
                    {
                        SetPlayerInterior(playerid, 14);
               SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][skin], 258.4893,-41.4008,1002.0234, 0, 0, 0, 0, 0, 0, 0);
             SpawnPlayer(playerid);
             SetPlayerInterior(playerid, 14);
             SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234);
             SetPlayerInterior(playerid, 14);
             SetPlayerFacingAngle(playerid, 270.0);
            SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
            SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
            TogglePlayerControllable(playerid, 0);
            SetPlayerSkin(playerid, PlayerInfo[playerid][skin]);
            SetPlayerScore(playerid, 1);
            GivePlayerMoney(playerid, 600);
                        ShowPlayerDialog(playerid, DIALOG_REG5, DIALOG_STYLE_LIST, \"[QUIZ] Which State is Los Angeles in?\",\"A.) New York\\nB.) California\\nC.) Neveda\\nD.) Florida\",\"Select\",\"\");
            InfoBoxForPlayer(playerid, \"Még nem végezted el a tutorialt, ezért most végivezetlek rajta.\");
         }
         if(PlayerInfo[playerid][banned] == 0)
         {
            SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][skin], PlayerInfo[playerid][Posx], PlayerInfo[playerid][Posy], PlayerInfo[playerid][Posz], 0.0, 0, 0, 0, 0, 0, 0);
                 SpawnPlayer(playerid);
                  SetPlayerInterior(playerid, PlayerInfo[playerid][interior]);
                  SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][VWorld]);
            SetPlayerPos(playerid, PlayerInfo[playerid][Posx], PlayerInfo[playerid][Posy], PlayerInfo[playerid][Posz]);
            SetPlayerSkin(playerid, PlayerInfo[playerid][skin]);
            SetPlayerScore(playerid, PlayerInfo[playerid][Level]);
                 GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                 PlayerInfo[playerid][AdminDuty] = 0;
              }
              else if(PlayerInfo[playerid][banned] == 1)
              {
            SendClientMessage(playerid, COLOR_RED, \"YOU HAVE BEEN BANNED FROM THIS SERVER, APPEAL ON THE WEBSITE.\");
                  Kick(playerid);
              }
                 
      }
      else
      {
         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Login\", \"Incorrect Password - Enter your password to login\", \"Login\",\"Cancel\");
      }
   }
}

 
 
Ehhez van kötve ugye minden, azt érzékeli, hogy be vagyok regisztrálva(másik elágazás[AccountRegistered]). Viszont a benne található adatokat nem tölti be.
Valami ötlet?
[mod]Javítottam mindent pawn code tagre![/mod]
« Utoljára szerkesztve: 2014. május 02. - 13:28:23 írta Dfoglalo »

Nem elérhető AnthonyGates

  • 546
  • AnthonyGates
    • Profil megtekintése
MySQL betöltés hiba
« Válasz #1 Dátum: 2014. május 02. - 12:40:48 »
0 Show voters
Sziasztok! Letöltöttem egy alap RolePlay játékmódot, a saját tudásom fejlesztésére, és az ötleteim megvalósítására.
MySQL alapon mûködik, rendben is megy, betölt mindent. Kivétel a karakterek adatait.
Bejelentkeztetõ dialog:
 
  if(response)
        {
            new query[1000],escapepass[26];
        mysql_real_escape_string(inputtext, escapepass);
      format(query, sizeof(query), \"SELECT * FROM Accounts WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", pName(playerid), escapepass);
      mysql_query(query);
      mysql_store_result();
      if(mysql_num_rows() != 0)
       {
         if(mysql_fetch_row_format(query, \"|\"))
         {
            sscanf(query,\"p<|>ddddddddfffdddddddddddd\",
               PlayerInfo[playerid][Tutorial],
               PlayerInfo[playerid][Level],
               PlayerInfo[playerid][Cash],
               PlayerInfo[playerid][Admin],
               PlayerInfo[playerid][AdminPass],
               PlayerInfo[playerid][AdminLogged],
               PlayerInfo[playerid][AdminDuty],
               PlayerInfo[playerid][skin],
               PlayerInfo[playerid][Posx],
               PlayerInfo[playerid][Posy],
               PlayerInfo[playerid][Posz],
               PlayerInfo[playerid][VWorld],
               PlayerInfo[playerid][interior],
               PlayerInfo[playerid][Age],
               PlayerInfo[playerid][Gender],
               PlayerInfo[playerid][Kicks],
               PlayerInfo[playerid][banned],
               PlayerInfo[playerid][bans],
               PlayerInfo[playerid][Muted],
               PlayerInfo[playerid][Faction],
               PlayerInfo[playerid][Rank],
               PlayerInfo[playerid][Job],
               PlayerInfo[playerid][House]);
         }

 



 case DIALOG_LOGIN:
{
        if(!response){ SendClientMessage(playerid, COLOR_RED, \"You decided to quit from the server.\"); Kick(playerid);}
        if(response)
        {
            new query[1000],escapepass[26];
        mysql_real_escape_string(inputtext, escapepass);
      format(query, sizeof(query), \"SELECT * FROM Accounts WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", pName(playerid), escapepass);
      mysql_query(query);
      mysql_store_result();
      if(mysql_num_rows() != 0)
       {
         if(mysql_fetch_row_format(query, \"|\"))
         {
            sscanf(query,\"p<|>ddddddddfffdddddddddddd\",
               PlayerInfo[playerid][Tutorial],
               PlayerInfo[playerid][Level],
               PlayerInfo[playerid][Cash],
               PlayerInfo[playerid][Admin],
               PlayerInfo[playerid][AdminPass],
               PlayerInfo[playerid][AdminLogged],
               PlayerInfo[playerid][AdminDuty],
               PlayerInfo[playerid][skin],
               PlayerInfo[playerid][Posx],
               PlayerInfo[playerid][Posy],
               PlayerInfo[playerid][Posz],
               PlayerInfo[playerid][VWorld],
               PlayerInfo[playerid][interior],
               PlayerInfo[playerid][Age],
               PlayerInfo[playerid][Gender],
               PlayerInfo[playerid][Kicks],
               PlayerInfo[playerid][banned],
               PlayerInfo[playerid][bans],
               PlayerInfo[playerid][Muted],
               PlayerInfo[playerid][Faction],
               PlayerInfo[playerid][Rank],
               PlayerInfo[playerid][Job],
               PlayerInfo[playerid][House]);
         }
         else
         {
             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Login\", \"Incorrect Password: Input your password\", \"Login\", \"Cancel\");
         }
                if(PlayerInfo[playerid][Tutorial] <= 3)
                    {
                        SetPlayerInterior(playerid, 14);
               SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][skin], 258.4893,-41.4008,1002.0234, 0, 0, 0, 0, 0, 0, 0);
             SpawnPlayer(playerid);
             SetPlayerInterior(playerid, 14);
             SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234);
             SetPlayerInterior(playerid, 14);
             SetPlayerFacingAngle(playerid, 270.0);
            SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
            SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
            TogglePlayerControllable(playerid, 0);
            SetPlayerSkin(playerid, PlayerInfo[playerid][skin]);
            SetPlayerScore(playerid, 1);
            GivePlayerMoney(playerid, 600);
                        ShowPlayerDialog(playerid, DIALOG_REG5, DIALOG_STYLE_LIST, \"[QUIZ] Which State is Los Angeles in?\",\"A.) New York\\nB.) California\\nC.) Neveda\\nD.) Florida\",\"Select\",\"\");
            InfoBoxForPlayer(playerid, \"Még nem végezted el a tutorialt, ezért most végivezetlek rajta.\");
         }
         if(PlayerInfo[playerid][banned] == 0)
         {
            SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][skin], PlayerInfo[playerid][Posx], PlayerInfo[playerid][Posy], PlayerInfo[playerid][Posz], 0.0, 0, 0, 0, 0, 0, 0);
                 SpawnPlayer(playerid);
                  SetPlayerInterior(playerid, PlayerInfo[playerid][interior]);
                  SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][VWorld]);
            SetPlayerPos(playerid, PlayerInfo[playerid][Posx], PlayerInfo[playerid][Posy], PlayerInfo[playerid][Posz]);
            SetPlayerSkin(playerid, PlayerInfo[playerid][skin]);
            SetPlayerScore(playerid, PlayerInfo[playerid][Level]);
                 GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
                 PlayerInfo[playerid][AdminDuty] = 0;
              }
              else if(PlayerInfo[playerid][banned] == 1)
              {
            SendClientMessage(playerid, COLOR_RED, \"YOU HAVE BEEN BANNED FROM THIS SERVER, APPEAL ON THE WEBSITE.\");
                  Kick(playerid);
              }
                 
      }
      else
      {
         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Login\", \"Incorrect Password - Enter your password to login\", \"Login\",\"Cancel\");
      }
   }
}

 
 
Ehhez van kötve ugye minden, azt érzékeli, hogy be vagyok regisztrálva(másik elágazás[AccountRegistered]). Viszont a benne található adatokat nem tölti be.
Valami ötlet?
[mod]Javítottam mindent pawn code tagre![/mod]
« Utoljára szerkesztve: 2014. május 02. - 13:28:23 írta Dfoglalo »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal