Skip to content

Instantly share code, notes, and snippets.

@AmyrAhmady
Created August 27, 2020 07:25
Show Gist options
  • Save AmyrAhmady/17f989c7ea4d79caf59569f2b10926aa to your computer and use it in GitHub Desktop.
Save AmyrAhmady/17f989c7ea4d79caf59569f2b10926aa to your computer and use it in GitHub Desktop.
local sampev = require 'lib.samp.events'
local raknet = require 'lib.samp.raknet'
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
end
function sampev.onSendVehicleSync(data)
--print('Hydra thrust angle: ' .. data.hydraThrustAngle[0] .. ', ' .. data.hydraThrustAngle[1])
print('VEHICLE SYNC GOING OUT')
print('\n\tdata.leftRightKeys:' .. tostring(data.leftRightKeys) .. '\
\tdata.upDownKeys :' .. tostring(data.upDownKeys) .. '\
\tdata.keysData :' .. tostring(data.keysData) .. '\
\tdata.quaternion : x: ' .. tostring(data.quaternion[1]) .. ', y: ' .. tostring(data.quaternion[2]) .. ', z: ' .. tostring(data.quaternion[3]) .. ', w: ' .. tostring(data.quaternion[4]) .. '\
\tdata.position : x: ' .. tostring(data.position.x) .. ', y: ' .. tostring(data.position.y) .. ', z: ' .. tostring(data.position.z) .. '\
\tdata.moveSpeed : x: ' .. tostring(data.moveSpeed.x) .. ', y: ' .. tostring(data.moveSpeed.y) .. ', z: ' .. tostring(data.moveSpeed.z) .. '\
\tdata.vehicleHealth :' .. tostring(data.vehicleHealth) .. '\
\tdata.playerHealth:' .. tostring(data.playerHealth) .. '\
\tdata.armor :' .. tostring(data.armor) .. '\
\tdata.currentWeapon :' .. tostring(data.currentWeapon) .. '\
\tdata.siren :' .. tostring(data.siren) .. '\
\tdata.landingGear :' .. tostring(data.landingGearState) .. '\
\tdata.trainSpeed :' .. tostring(data.trainSpeed) .. '\
\tdata.trailerId :' .. tostring(data.trailerId) )
end
function sampev.onVehicleSync(playerId, vehicleId, data)
--print('Hydra thrust angle: ' .. data.hydraThrustAngle[0] .. ', ' .. data.hydraThrustAngle[1])
print('VEHICLE SYNC COMING FROM PLAYER ' .. playerId)
print('\n\tdata.leftRightKeys:' .. tostring(data.leftRightKeys) .. '\
\tdata.upDownKeys :' .. tostring(data.upDownKeys) .. '\
\tdata.keysData :' .. tostring(data.keysData) .. '\
\tdata.quaternion : x: ' .. tostring(data.quaternion[1]) .. ', y: ' .. tostring(data.quaternion[2]) .. ', z: ' .. tostring(data.quaternion[3]) .. ', w: ' .. tostring(data.quaternion[4]) .. '\
\tdata.position : x: ' .. tostring(data.position.x) .. ', y: ' .. tostring(data.position.y) .. ', z: ' .. tostring(data.position.z) .. '\
\tdata.moveSpeed : x: ' .. tostring(data.moveSpeed.x) .. ', y: ' .. tostring(data.moveSpeed.y) .. ', z: ' .. tostring(data.moveSpeed.z) .. '\
\tdata.vehicleHealth :' .. tostring(data.vehicleHealth) .. '\
\tdata.playerHealth:' .. tostring(data.playerHealth) .. '\
\tdata.armor :' .. tostring(data.armor) .. '\
\tdata.currentWeapon :' .. tostring(data.currentWeapon) .. '\
\tdata.siren :' .. tostring(data.siren) .. '\
\tdata.landingGear :' .. tostring(data.landingGear) .. '\
\tdata.trainSpeed :' .. tostring(data.trainSpeed) .. '\
\tdata.trailerId :' .. tostring(data.trailerId) )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment