Advertisement
Guest User

K

a guest
Nov 9th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. else if (str.substr(0, 5) == "/tape ") {
  2. if (!canSB(((PlayerInfo*)(peer->data))->rawName, ((PlayerInfo*)(peer->data))->tankIDPass))break;
  3. if (str.substr(5, cch.length() - 5 - 1) == "") continue;
  4. if (((PlayerInfo*)(peer->data))->rawName == str.substr(5, cch.length() - 5 - 1)) continue;
  5. if ((str.substr(5, cch.length() - 5 - 1) == "dark") || (str.substr(5, cch.length() - 5 - 1) == "juantlo") || (str.substr(5, cch.length() - 5 - 1) == "legend") || (str.substr(5, cch.length() - 5 - 1) == "hadi") || (str.substr(5, cch.length() - 5 - 1) == "FocusedSG") || (str.substr(5, cch.length() - 5 - 1) == "QueenieSG") || (str.substr(5, cch.length() - 5 - 1) == "focusedsg") || (str.substr(5, cch.length() - 5 - 1) == "queeniesg")) continue;
  6.  
  7. cout << "Server operator " << ((PlayerInfo*)(peer->data))->rawName << " has taped " << str.substr(5, cch.length() - 5 - 1) << "." << endl;
  8.  
  9. ENetPeer * currentPeer;
  10.  
  11. GamePacket p = packetEnd(appendString(appendString(createPacket(), "OnConsoleMessage"), "`#** `$The Ancient Ones `ohave `4taped `2" + str.substr(5, cch.length() - 5 - 1) + " `#** `o(`4/rules `oto see the rules!)"));
  12. for (currentPeer = server->peers;
  13. currentPeer < &server->peers[server->peerCount];
  14. ++currentPeer)
  15. {
  16. if (currentPeer->state != ENET_PEER_STATE_CONNECTED)
  17. continue;
  18. ENetPacket * packet = enet_packet_create(p.data,
  19. p.len,
  20. ENET_PACKET_FLAG_RELIABLE);
  21.  
  22. if (((PlayerInfo*)(currentPeer->data))->rawName == str.substr(5, cch.length() - 5 - 1)) {
  23. if (((PlayerInfo*)(currentPeer->data))->haveGrowId == false) continue;
  24. GamePacket ps = packetEnd(appendString(appendString(createPacket(), "OnConsoleMessage"), "`#** `$The Ancient Ones `ohave used `#Tape `oon `2" + str.substr(5, cch.length() - 5 - 1) + "`o! `#**"));
  25. ENetPacket * packet = enet_packet_create(ps.data,
  26. ps.len,
  27. ENET_PACKET_FLAG_RELIABLE);
  28. enet_peer_send(currentPeer, 0, packet);
  29.  
  30. GamePacket ps2 = packetEnd(appendInt(appendString(appendString(appendString(appendString(createPacket(), "OnAddNotification"), "interface/atomic_button.rttex"), "`0Warning from `4Admin`0: You've been `4duct-taped `0from Private Server for 0hrs 0mins"), "audio/hub_open.wav"), 0));
  31. ENetPacket * packet2 = enet_packet_create(ps2.data,
  32. ps2.len,
  33. ENET_PACKET_FLAG_RELIABLE);
  34. enet_peer_send(currentPeer, 0, packet2);
  35. GamePacket ps3 = packetEnd(appendString(appendString(createPacket(), "OnConsoleMessage"), "`oWarning from `4Admin`o: You've been `4duct-taped `ofrom Private Server for 730 days"));
  36. ENetPacket * packet3 = enet_packet_create(ps3.data,
  37. ps3.len,
  38. ENET_PACKET_FLAG_RELIABLE);
  39. enet_peer_send(currentPeer, 0, packet3);
  40. if (((PlayerInfo*)(currentPeer->data))->haveGrowId) {
  41.  
  42. PlayerInfo* p = ((PlayerInfo*)(currentPeer->data));
  43.  
  44. string username = PlayerDB::getProperName(p->rawName);
  45.  
  46. std::ifstream od("players/" + username + ".json");
  47. if (od.is_open()) {
  48. }
  49.  
  50. std::ofstream o("players/" + username + ".json");
  51. if (!o.is_open()) {
  52. cout << GetLastError() << endl;
  53. _getch();
  54. }
  55. json j;
  56.  
  57. int clothback = p->cloth_back;
  58. int clothhand = p->cloth_hand;
  59. int clothface = p->cloth_face;
  60. int clothhair = p->cloth_hair;
  61. int clothfeet = p->cloth_feet;
  62. int clothpants = p->cloth_pants;
  63. int clothneck = p->cloth_necklace;
  64. int clothshirt = p->cloth_shirt;
  65. int clothmask = p->cloth_mask;
  66.  
  67.  
  68. string password = ((PlayerInfo*)(currentPeer->data))->tankIDPass;
  69.  
  70. j["ClothBack"] = clothback;
  71. j["ClothHand"] = clothhand;
  72. j["ClothFace"] = 408;
  73. j["ClothShirt"] = clothshirt;
  74. j["ClothPants"] = clothpants;
  75. j["ClothNeck"] = clothneck;
  76. j["ClothHair"] = clothhair;
  77. j["ClothFeet"] = clothfeet;
  78. j["ClothMask"] = clothmask;
  79.  
  80. j["isBanned"] = 0;
  81.  
  82. j["adminLevel"] = 0;
  83. j["password"] = hashPassword(password);
  84. j["username"] = username;
  85.  
  86.  
  87. o << j << std::endl;
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement