Advertisement
FocusedSG

saving code

Dec 23rd, 2018
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. if (((PlayerInfo*)(peer->data))->isIn)
  2. {
  3. if (((PlayerInfo*)(peer->data))->haveGrowId) {
  4.  
  5.  
  6. PlayerInfo* p = ((PlayerInfo*)(peer->data));
  7.  
  8. string username = PlayerDB::getProperName(p->rawName);
  9.  
  10. std::ifstream od("players/" + username + ".json");
  11. if (od.is_open()) {
  12. }
  13.  
  14. std::ofstream o("players/" + username + ".json");
  15. if (!o.is_open()) {
  16. cout << GetLastError() << endl;
  17. _getch();
  18. }
  19. json j;
  20.  
  21. int clothback = p->cloth_back;
  22. int clothhand = p->cloth_hand;
  23. int clothface = p->cloth_face;
  24. int clothhair = p->cloth_hair;
  25. int clothfeet = p->cloth_feet;
  26. int clothpants = p->cloth_pants;
  27. int clothneck = p->cloth_necklace;
  28. int clothshirt = p->cloth_shirt;
  29. int clothmask = p->cloth_mask;
  30. int level = p->level;
  31. int gems = p->gems;
  32. int mute = p->mute;
  33. int ban = p->ban;
  34.  
  35. string password = ((PlayerInfo*)(peer->data))->tankIDPass;
  36.  
  37. j["ClothBack"] = clothback;
  38. j["ClothHand"] = clothhand;
  39. j["ClothFace"] = clothface;
  40. j["ClothShirt"] = clothshirt;
  41. j["ClothPants"] = clothpants;
  42. j["ClothNeck"] = clothneck;
  43. j["ClothHair"] = clothhair;
  44. j["ClothFeet"] = clothfeet;
  45. j["ClothMask"] = clothmask;
  46. j["isMuted"] = mute;
  47. j["isBanned"] = ban;
  48. j["Gems"] = gems;
  49. j["Level"] = level;
  50. j["adminLevel"] = 0;
  51. j["password"] = hashPassword(password);
  52. j["username"] = username;
  53.  
  54. o << j << std::endl;
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement