Advertisement
Garotin

Untitled

Oct 7th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.90 KB | None | 0 0
  1. stock MySQL_Login(playerid)
  2. {
  3.     new query[300];
  4.     format(query, sizeof(query), "SELECT * FROM usuarios WHERE nick = '%s'", Nome(playerid));
  5.     mysql_query(Conexao, query);
  6.     mysql_store_result();
  7.     while(mysql_fetch_row_format(query,"|"))
  8.     {
  9.         PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "level");
  10.         SetPlayerScore(playerid, PlayerInfo[playerid][Level]);
  11.         PlayerInfo[playerid][Exp] = cache_get_field_content_int(0, "exp");
  12.         PlayerInfo[playerid][Dinheiro] = cache_get_field_content_int(0, "dinheiro");
  13.         GivePlayerMoney(playerid, PlayerInfo[playerid][Dinheiro]);
  14.         PlayerInfo[playerid][Admin] = cache_get_field_content_int(0, "admin");
  15.         PlayerInfo[playerid][Skin] = cache_get_field_content_int(0, "skin");
  16.         SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  17.         PlayerInfo[playerid][PosX] = cache_get_field_content_float(0, "posx");
  18.         PlayerInfo[playerid][PosY] = cache_get_field_content_float(0, "posy");
  19.         PlayerInfo[playerid][PosZ] = cache_get_field_content_float(0, "posz");
  20.         cache_get_field_content(0, "email", PlayerInfo[playerid][Email], Conexao, 500);
  21.         PlayerInfo[playerid][Fome] = cache_get_field_content_int(0, "fome");
  22.         PlayerInfo[playerid][Sede] = cache_get_field_content_int(0, "sede");
  23.         PlayerInfo[playerid][Sono] = cache_get_field_content_int(0, "sono");
  24.         PlayerInfo[playerid][Rm] = cache_get_field_content_int(0, "rm");
  25.         PlayerInfo[playerid][Rs] = cache_get_field_content_int(0, "rs");
  26.         cache_get_field_content(0, "profissao", PlayerInfo[playerid][Profissao], Conexao, 100);
  27.         cache_get_field_content(0, "playercor", PlayerInfo[playerid][PlayerCor], Conexao, 100);
  28.         PlayerInfo[playerid][ContaBanco] = cache_get_field_content_int(0, "contabanco");
  29.         PlayerInfo[playerid][SaldoBanco] = cache_get_field_content_int(0, "saldobanco");
  30.         PlayerInfo[playerid][TemCasa] = cache_get_field_content_int(0, "temcasa");
  31.         PlayerInfo[playerid][CasaID] = cache_get_field_content_int(0, "casaid");
  32.         PlayerInfo[playerid][CPosX] = cache_get_field_content_float(0, "cposx");
  33.         PlayerInfo[playerid][CPosY] = cache_get_field_content_float(0, "cposy");
  34.         PlayerInfo[playerid][CPosZ] = cache_get_field_content_float(0, "cposz");
  35.     }
  36.     mysql_free_result();
  37.     format(query, sizeof(query), "UPDATE usuarios SET IP='%s' WHERE nick='%s'",
  38.     IP(playerid), Nome(playerid));
  39.     mysql_query(Conexao, query);
  40.     SendClientMessage(playerid, 0x82C0FFAA, "(CONTA) Logado com sucesso");
  41.     PlayerInfo[playerid][pLogado] = true;
  42.     SetTimerEx_("AtualizarGrana", 500, 1000, -1, "d", playerid);
  43.     SetTimerEx_("FomeT", 600000, 600000, 1, "d", playerid);
  44.     SetTimerEx_("SedeT", 400000, 400000, 1, "d", playerid);
  45.     SetTimerEx_("SonoT", 510000, 510000, 1, "d", playerid);
  46.     SetTimerEx_("RodapeT", 2000, 1500, 1, "d", playerid);
  47.     PlayerInfo[playerid][pTime] = SetTimerEx_("UPLEVEL", 1500, 1000, -1, "i", playerid);
  48.     SetPlayerColor(playerid, PlayerInfo[playerid][PlayerCor]);
  49.     PlayerTextDrawShow(playerid, Rodape0);
  50.     PlayerTextDrawShow(playerid, Rodape1);
  51.     PlayerTextDrawShow(playerid, Rodape2);
  52.     PlayerTextDrawShow(playerid, Rodape3);
  53.     PlayerTextDrawShow(playerid, Necessidade0);
  54.     PlayerTextDrawShow(playerid, Necessidade1);
  55.     PlayerTextDrawShow(playerid, Necessidade2);
  56.     PlayerTextDrawShow(playerid, Necessidade3);
  57.     PlayerTextDrawShow(playerid, Necessidade4);
  58.     PlayerTextDrawTextSize(playerid,Necessidade5, 530.000000 + PlayerInfo[playerid][Fome], 7.000000);
  59.     PlayerTextDrawShow(playerid, Necessidade5);
  60.     PlayerTextDrawShow(playerid, Necessidade6);
  61.     PlayerTextDrawShow(playerid, Necessidade7);
  62.     PlayerTextDrawTextSize(playerid,Necessidade8, 530.000000 + PlayerInfo[playerid][Sede], 7.000000);
  63.     PlayerTextDrawShow(playerid, Necessidade8);
  64.     PlayerTextDrawShow(playerid, Necessidade9);
  65.     PlayerTextDrawShow(playerid, Necessidade10);
  66.     PlayerTextDrawTextSize(playerid,Necessidade11, 530.000000 + PlayerInfo[playerid][Sono], 7.000000);
  67.     PlayerTextDrawShow(playerid, Necessidade11);
  68.     if(PlayerInfo[playerid][TemCasa] == 0)
  69.     {
  70.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ], 179.9741, 0, 0, 0, 0, 0, 0);
  71.     }
  72.     if(PlayerInfo[playerid][TemCasa] == 1)
  73.     {
  74.         SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], PlayerInfo[playerid][CPosX], PlayerInfo[playerid][CPosY], PlayerInfo[playerid][CPosZ], 179.9741, 0, 0, 0, 0, 0, 0);
  75.     }
  76.     SpawnPlayer(playerid);
  77.     new query3[200];
  78.     format(query3, sizeof(query3), "SELECT * FROM tutorial WHERE nick='%s'", Nome(playerid));
  79.     mysql_query(Conexao, query3);
  80.     mysql_store_result();
  81.     new rows = mysql_num_rows();
  82.     if(!rows)
  83.     {
  84.         if(!IsPlayerNPC(playerid))
  85.         {
  86.             if(Tuto[playerid] == 0)
  87.             {
  88.                 TogglePlayerSpectating(playerid, 1);
  89.                 SetTimerEx_("IniciarTuto", 1000, 1000, 1, "d", playerid);
  90.             }
  91.         }
  92.     }
  93.     mysql_free_result();
  94.     return 1;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement