Jump to content

some camera shit....


Deepu

Recommended Posts

function muthru () 
   if isElement(localPlayer) then 
   setCameraTarget(localPlayer) 
   end 
end 
  
function closer () 
   if RCPlane and isElement(RCPlane) then 
   if renderHandler then 
   removeEventHandler("onClientRender", root, renderCameraMatrix) 
   guiSetVisible(controls, false) 
   showCursor(false) 
   local health = getElementHealth(localPlayer) 
   blowVehicle(RCPlane) 
   setElementHealth(localPlayer, tonumber(health)) 
   addEventHandler("onClientRender", root, muthru) 
   end 
   end 
end 
  
function getPositionFromElementOffset(element,offX,offY,offZ) 
    local m = getElementMatrix ( element ) 
    local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] 
    local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] 
    local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] 
    return x, y, z 
end 
  
local renderCameraMatrix = function () 
 if isElement(RCPlane)then 
 local vX, vY, vZ = getElementPosition(RCPlane) 
 local cX, cY, cZ = getPositionFromElementOffset(RCPlane, 0, -4, 2) 
 rolls = getElementRotation(RCPlane) 
 setCameraMatrix(cX, cY, cZ, vX, vY, vZ, rolls) 
 end 
end 

so, the problem is I can setTarget to me but its not the same camera type like I played before.....

How to stop rendering this renderCameraMatrix so I can set the camera target back to mine... ?

please help it is urgent

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