Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
847 B
3
Indexable
else if (actual_command == "/bune") {
PlayerMoving dats_{};
dats_.packetType = 28;
dats_.characterState = 0x0;
dats_.x = 4;
dats_.y = 0;

dats_.y |= 0x40;

dats_.punchX = 0;
dats_.punchY = 0;
dats_.XSpeed = 0;
dats_.YSpeed = 0;
dats_.netID = pInfo(peer)->netID;
dats_.plantingTree = 0;

std::string label = "ametsaGay";
uint16_t labelLen = label.length();
uint8_t teamCount = 2;

BYTE* rawData = (BYTE*)malloc(56 + 2 + labelLen + 4 + 1 + (teamCount * 4));
rawData = packPlayerMoving(&dats_);

memcpy(rawData + 56, &labelLen, 2);
memcpy(rawData + 56 + 2, label.data(), labelLen);
memcpy(rawData + 56 + 2 + labelLen, &teamCount, 1);

uint32_t* teamScore = new uint32_t[teamCount]{0};
memcpy(rawData + 56 + 2 + labelLen + 1, teamScore, teamCount * 4);

send_raw(peer, 4, rawData, 56 + 2 + labelLen + 1 + (teamCount * 4), ENET_PACKET_FLAG_RELIABLE);
}