- 90
- 7
- Версия SA-MP
-
- 0.3.7-R3
Появилась необходимость отправлять через скрипт фейк синхру машины. Именно ОТПРАВЛЯТЬ. Сделал такой код. А что делать дальше? В carData копируется data из sampev.onSendVehicleSync.
Код:
local bs=bitStream.new()
bs:writeInt16(playerId)
bs:writeInt16(carId)
bs:writeInt16(carData.leftRightKeys)
bs:writeInt16(carData.upDownKeys)
bs:writeInt16(carData.keysData)
bs:writeFloat(carData.quaternion[1])
bs:writeFloat(carData.quaternion[2])
bs:writeFloat(carData.quaternion[3])
bs:writeFloat(carData.quaternion[4])
bs:writeFloat(carData.position.x)
bs:writeFloat(carData.position.y)
bs:writeFloat(carData.position.z)
bs:writeFloat(carData.moveSpeed.x)
bs:writeFloat(carData.moveSpeed.y)
bs:writeFloat(carData.moveSpeed.z)
bs:writeInt16(0)
bs:writeInt8(utils.compress_health_and_armor(carData.playerHealth, carData.armor))
bs:writeInt8(carData.currentWeapon)
bs:writeBool(carData.siren)
bs:writeBool(carData.landingGear)
bs:writeBool(carData.trainSpeed ~= nil)
if carData.trainSpeed ~= nil then
bs:writeInt32(carData.trainSpeed)
end
bs:writeBool(carData.trailerId ~= nil)
if carData.trailerId ~= nil then
bs:writeInt16(carData.trailerId)
end
bs:sendPacket()