Advertisement
Guest User

Untitled

a guest
Apr 6th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. stock AssignpDane(playerid)
  2. {
  3. cache_set_active(pDane[playerid][Cache_ID]); //Ponownie aktywujemy Cache gracza.
  4.  
  5. //Pobieramy dane z cache
  6. cache_get_value_int(0, "uid", pDane[playerid][UID]);
  7. cache_get_value_int(0, "skinid", pDane[playerid][SkinID]);
  8. cache_get_value_int(0, "bank", pDane[playerid][wBank]);
  9. cache_get_value_int(0, "money", pDane[playerid][Money]);
  10. cache_get_value_int(0, "score", pDane[playerid][Score]);
  11. cache_get_value_int(0, "plec", pDane[playerid][Plec]);
  12. cache_get_value_int(0, "wiek", pDane[playerid][Wiek]);
  13. cache_get_value_int(0, "vip", pDane[playerid][Vip]);
  14. cache_get_value_int(0, "frakcja", pDane[playerid][Frakcja]);
  15.  
  16.  
  17. cache_delete(pDane[playerid][Cache_ID]); //Usuwa caly Cache
  18. pDane[playerid][Cache_ID] = MYSQL_INVALID_CACHE; //Resetujemy Cache ID
  19. return 1;
  20. }
  21.  
  22. stock SaveAccount(playerid)
  23. {
  24. new query[258];
  25. mysql_format(SQL_ID, query, sizeof query, "UPDATE kontagraczy SET bank = %i, money = %i, score = %i, skinid = %i WHERE uid = %i",
  26. pDane[playerid][wBank],
  27. GetMoney(playerid),
  28. GetPlayerScore(playerid),
  29. GetPlayerSkin(playerid),
  30. pDane[playerid][UID]);
  31. mysql_tquery(SQL_ID, query);
  32. return 1;
  33. }
  34.  
  35. stock CreateAccount(playerid)
  36. {
  37. new query[258], string[258];
  38. strcat(query, "INSERT INTO kontagraczy(");
  39. //
  40. strcat(query, "name,");
  41. strcat(query, "password,");
  42. strcat(query, "skinid,");
  43. strcat(query, "bank,");
  44. strcat(query, "plec,");
  45. strcat(query, "wiek,");
  46. strcat(query, "vip,");
  47. strcat(query, "frakcja,");
  48. strcat(query, "money");
  49.  
  50. //
  51. strcat(query, ") VALUES (");
  52.  
  53. format(string, 258, "'%s',", PlayerName(playerid));
  54. strcat(query, string);
  55. format(string, 258, "'%s',", pDane[playerid][Password]);
  56. strcat(query, string);
  57. format(string, 258, "'%i',", pDane[playerid][SkinID]);
  58. strcat(query, string);
  59. format(string, 258, "'%i',", pDane[playerid][wBank]);
  60. strcat(query, string);
  61. format(string, 258, "'%i',", pDane[playerid][Plec]);
  62. strcat(query, string);
  63. format(string, 258, "'%i',", pDane[playerid][Wiek]);
  64. strcat(query, string);
  65. format(string, 258, "'%i',", pDane[playerid][Vip]);
  66. strcat(query, string);
  67. format(string, 258, "'%i',", pDane[playerid][Frakcja]);
  68. strcat(query, string);
  69. format(string, 258, "'%i'",START_MONEY);
  70. strcat(query, string);
  71.  
  72. //
  73. strcat(query, ")");
  74. mysql_tquery(SQL_ID, query, "OnAccountCreate", "i", playerid);
  75.  
  76. return 1;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement