ricop522

[PAWN] Carregar player usando MySQL

Feb 19th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.88 KB | None | 0 0
  1. enum red_info
  2. {
  3.         nick[24],
  4.         senha[128],
  5.         Score,
  6.         Dinheiro,
  7.         Level,
  8.         CarteiraNivel,
  9.         Slots,
  10.         Carros,
  11.         Fuel,
  12.        
  13.     Logado,
  14.         TesteAutoEscola,
  15.         AutoEscolaTeste,
  16.         TempoAutoEscola,
  17.         ComprandoCasa,
  18.         BOT1,
  19.         BOT2,
  20.         ValorEntrega,
  21.         InEntrega,
  22.         VMODEL
  23. }
  24.  
  25. new PlayerInfo[MAX_PLAYERS][red_info];
  26.  
  27.  
  28. forward CarregarPlayer(playerid);
  29. public CarregarPlayer(playerid)
  30. {
  31.         new result[512];
  32.         format(result, sizeof(result),"SELECT * FROM jogadores WHERE player= '%s'",Nome(playerid));
  33.         mysql_query(result);
  34.         mysql_store_result();
  35.         if(mysql_fetch_row(result))
  36.         {
  37.                 sscanf(result, "e<p<|>s[24]s[128]iiiiiii>",PlayerInfo[playerid]);                
  38.         }
  39.         mysql_free_result();
  40.     return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment