Jump to content

Sistema de Recuo


Recommended Posts

Estou tentando fazer um script de recuo que funcione de forma mais realista mexendo o eixo Z também, porém da forma que tentei fazer não funcionou, se alguém puder me dar uma ajuda fico grato.

local weap = {shot=false,timer=false}
addEventHandler("onClientPlayerWeaponFire", localPlayer, function()
    local rot = getPedCameraRotation(localPlayer)
    if (isTimer(weap.timer)) then killTimer(weap.timer); end
    if (not weap.shot) then
        setCameraMatrix (x, y-0.2, z+0.3, lx, ly, lz)
		setCameraTarget ( localPlayer )
        weap.shot = true
        weap.timer = setTimer(setPedCameraRotation, 50, 1, localPlayer, -(rot+0.28))
    else
        setCameraMatrix (x, y+0.2, z+0.3, lx, ly, lz)
		setCameraTarget ( localPlayer )
        weap.shot = false
        weap.timer = setTimer(setPedCameraRotation, 50, 1, localPlayer, -(rot-0.28))
    end
end)

 

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...