Advertisement
Guest User

Punch effect

a guest
Jan 6th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. else if (str.substr(0, 3) == "/p ") {
  2.  
  3. //((PlayerInfo*)(peer->data))->puncheffect;
  4.  
  5. /*PlayerInfo* info = ((PlayerInfo*)(peer->data));
  6. int netID = info->netID;*/
  7. ENetPeer * currentPeer;
  8.  
  9.  
  10.  
  11.  
  12.  
  13. for (currentPeer = server->peers;
  14. currentPeer < &server->peers[server->peerCount];
  15. ++currentPeer)
  16. {
  17. if (currentPeer->state != ENET_PEER_STATE_CONNECTED)
  18. continue;
  19. if (isHere(peer, currentPeer)) {
  20. int ID = atoi(str.substr(3).c_str());
  21. ((PlayerInfo*)(currentPeer->data))->puncheffect = ID;
  22. sendPuncheffect(currentPeer);
  23. /*PlayerMoving data;
  24. data.packetType = 0x14;
  25. data.characterState = 0; // animation
  26. data.x = 1000;
  27. data.y = 100;
  28. data.punchX = 0;
  29. data.punchY = 0;
  30. data.XSpeed = 300;
  31. data.YSpeed = 600;
  32. data.netID = netID;
  33. data.plantingTree = state;
  34. BYTE* raw = packPlayerMoving(&data);
  35. int var = ((PlayerInfo*)(currentPeer->data))->puncheffect; // placing and breking
  36. memcpy(raw + 1, &var, 3);
  37. SendPacketRaw(4, raw, 56, 0, currentPeer, ENET_PACKET_FLAG_RELIABLE); */
  38. /*if (((PlayerInfo*)(currentPeer->data))->haveGrowId) {
  39.  
  40. PlayerInfo* p = ((PlayerInfo*)(currentPeer->data));
  41.  
  42. string username = PlayerDB::getProperName(p->rawName);
  43.  
  44. std::ifstream od("players/" + username + ".json");
  45. if (od.is_open()) {
  46. }
  47.  
  48. std::ofstream o("players/" + username + ".json");
  49. if (!o.is_open()) {
  50. cout << GetLastError() << endl;
  51. _getch();
  52. }
  53. json j;
  54.  
  55. int clothback = p->cloth_back;
  56. int clothhand = p->cloth_hand;
  57. int clothface = p->cloth_face;
  58. int clothhair = p->cloth_hair;
  59. int clothfeet = p->cloth_feet;
  60. int clothpants = p->cloth_pants;
  61. int clothneck = p->cloth_necklace;
  62. int clothshirt = p->cloth_shirt;
  63. int clothmask = p->cloth_mask;
  64. int level = p->level;
  65. int puncheffect = p->puncheffect;
  66. int ban = p->ban;
  67. string password = ((PlayerInfo*)(currentPeer->data))->tankIDPass;
  68.  
  69. j["ClothBack"] = clothback;
  70. j["ClothHand"] = clothhand;
  71. j["ClothFace"] = clothface;
  72. j["ClothShirt"] = clothshirt;
  73. j["ClothPants"] = clothpants;
  74. j["ClothNeck"] = clothneck;
  75. j["ClothHair"] = clothhair;
  76. j["ClothFeet"] = clothfeet;
  77. j["ClothMask"] = clothmask;
  78.  
  79. j["isBanned"] = ban;
  80. j["Level"] = level;
  81. j["puncheffect"] = puncheffect;
  82.  
  83. j["adminLevel"] = 0;
  84. j["password"] = hashPassword(password);
  85. j["username"] = username;
  86.  
  87.  
  88. o << j << std::endl;
  89. }*/
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement