Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2. // No topo
  3. new playerRow[MAX_PLAYERS];
  4.  
  5.  
  6. // No inicio de OnPlayerLoginBPS
  7. format(string, sizeof (string), "SELECT * FROM `player` WHERE BINARY nome = '%s' LIMIT 1", NomePlayer(playerid));
  8. mysql_tquery(serverMysql, string, "onLoadPlayerRow", "i", playerid);
  9.  
  10.  
  11. // em qualquer lugar
  12. serverCallback: onLoadPlayerRow(playerid) {
  13.  
  14. playerRow[playerid] = -1;
  15.  
  16. if ( cache_get_row_count()) {
  17.  
  18. playerRow[playerid] = cache_get_field_content_int(0, "id");
  19. }
  20. }
  21.  
  22.  
  23. // Ai em casa UPDATE, você ao invés de colocar "WHERE nome = '%s',
  24. // voce salva os negocios no ID da row que foi armazenado em OnPlayerLoginBPS
  25. format(string, sizeof (string), "UPDATE `player` SET `vip_vencimento` = TIMESTAMPADD(MONTH, 1, CURRENT_TIMESTAMP()) WHERE `id` = '%d'", playerRow[playerid]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement