Jump to content

Camera Snake in car/ Дрожание камеры на скорости


Recommended Posts

Client:

local MIN_VALUE = 0
local MAX_VALUE = 15

function RenderShakeEffect()
   local vehicle = getPedOccupiedVehicle(localPlayer)
   if vehicle then
      local vx, vy, vz = getElementVelocity(vehicle)
      local actualspeed = (vx^2 + vy^2 + vz^2)^(0.5)
      local kmh = actualspeed * 180
      if kmh >= 300 then
         setCameraShakeLevel(math.random(MIN_VALUE,MAX_VALUE))
      else
         setCameraShakeLevel(0)
      end
   end
end
addEventHandler("onClientRender", root, RenderShakeEffect)

 

Edited by Hydra
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...