Advertisement
RogerGomesCosta

Untitled

Jul 12th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.93 KB | None | 0 0
  1. case DIALOG_LOGIN:
  2.         {
  3.             if(!response) Kick(playerid);
  4.             else
  5.             {
  6.                 new szString[128],
  7.                     DBResult:ResultQuery,
  8.                     EnPassword[130];
  9.                 WP_Hash(EnPassword, sizeof(EnPassword), inputtext);
  10.                 format(szString, 128, "SELECT * FROM Users WHERE Nick = '%s' AND Password = '%s'", GetPlayerName(playerid), EnPassword);
  11.                 ResultQuery = db_query(DataBase, szString);
  12.                 if(db_num_rows(ResultQuery)) // Se existe o nickname e a Senha conferir...
  13.                 {
  14.                     new szResult[16];
  15.                     PlayerInfo[playerid][pSkin] = SQLiteGetResultFloatAssoc(ResultQuery, "Skin");
  16.                     PlayerInfo[playerid][playermoney] = SQLiteGetResultFloatAssoc(ResultQuery, "Money");
  17.                     PlayerInfo[playerid][pInterior] = SQLiteGetResultFloatAssoc(ResultQuery, "Interior");
  18.                     for(new i = 0; i < 13; i++)
  19.                     {
  20.                         new str[20];
  21.                         format(str, sizeof str, "WeaponSlot%d", i);
  22.                         PlayerInfo[playerid][pWeapon][i] = SQLiteGetResultFloatAssoc(ResultQuery, str);
  23.                         format(str, sizeof str, "WeaponSlotAmmo%d", i);
  24.                         PlayerInfo[playerid][pAmmo][i] = SQLiteGetResultFloatAssoc(ResultQuery, str);
  25.                     }
  26.                
  27.                     TextDrawHideForPlayer(playerid, BoasVindas);
  28.                     TextDrawHideForPlayer(playerid, BoasVindas2);
  29.                     SendClientMessage(playerid, COLOR_WHITE, "[SERVER] Sua conta foi autenticada com sucesso!");
  30.                     PlayerInfo[playerid][Registered] = true;
  31.                     PlayerInfo[playerid][Logged] = true;
  32.  
  33.                     //sscanf(pos, "ffff", PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], PlayerInfo[playerid][pA]);
  34.                     //SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ], PlayerInfo[playerid][pA], 24, 100, 0, 0, 0, 0);
  35.                 }
  36.                 else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, RGB_COLOR_GOLD"CONTA CADASTRADA", RGB_COLOR_WHITE"Digite a senha dessa conta:", "Logar", "Sair");
  37.             }
  38.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement