- 2,140
- 1,782
- Версия MoonLoader
- .026-beta
Отправляются пакеты серверу
А если это 200 пакет(VehicleSyncData) то как перезаписать vehicleId если там другой айди транспорта ?
Lua:
local bs = raknetNewBitStream()
local bytes = {
{207, 0, 0, 128, 255, 32, 0, 193, 117, 9, 197, 1, 101, 23, 69, 250, 213, 162, 63, 118, 2, 18, 63, 0, 0, 0, 0, 0, 0, 0, 0, 97, 71, 82, 191, 100, 0, 0, 0, 53, 35, 16, 189, 105, 155, 69, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 4, 232, 128, },
{200, 186, 5, 0, 0, 0, 0, 0, 0, 218, 37, 87, 63, 174, 144, 197, 188, 161, 162, 107, 188, 111, 140, 10, 191, 76, 202, 6, 197, 15, 150, 23, 69, 66, 93, 203, 190, 2, 94, 47, 184, 213, 21, 149, 55, 53, 204, 11, 186, 0, 192, 183, 68, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
}
for _,v in pairs(bytes) do
raknetBitStreamWriteInt8(bs,v)
end
raknetSendBitStream(bs)
raknetDeleteBitStream(bs)
C:
struct VehicleSyncData {
uint16_t vehicleId;
uint16_t leftRightKeys;
uint16_t upDownKeys;
union {
uint16_t keysData;
struct SampKeys keys;
};
float quaternion[4];
struct VectorXYZ position;
struct VectorXYZ moveSpeed;
float vehicleHealth;
uint8_t playerHealth;
uint8_t armor;
uint8_t currentWeapon;
uint8_t siren;
uint8_t landingGearState;
uint16_t trailerId;
union {
float trainSpeed;
uint16_t hydraThrustAngle[2];
};
} __attribute__ ((packed));