UserToDelete Posted June 29, 2015 Share Posted June 29, 2015 Bueno, hola, lo que queria saber era (al hacer un FirstPerson) Como obtener que el matrix se quede mirando para alante, y no para un sitio fijo, es decir, necesito como "obtener" x+2 o y+2 depende de a donde mire, y no se hacer eso lo unico que logre es esto, pero no se como configurar la camara para que mire para delante en el coche fp = { enable = false } function fp.main () if isPedInVehicle(localPlayer) and fp.enable then setPedHeadless(localPlayer, true) local rotation = getPedRotation(localPlayer) local bx,by,bz = getPedBonePosition(localPlayer, 5) local cx,cy,cz,crx,cry,crz,cr,cf = getCameraMatrix() setCameraMatrix(bx,by,bz) setPedCameraRotation(localPlayer, rotation) elseif not isPedInVehicle(localPlayer) then setCameraTarget(localPlayer) setPedHeadless(localPlayer, false) end end function fp.render () if not fp.enable then addEventHandler("onClientRender", root, fp.main) fp.enable = true else removeEventHandler("onClientRender", root, fp.main) fp.enable = false setPedHeadless(localPlayer, false) repeat setCameraTarget(localPlayer) until getCameraTarget() == localPlayer end end addCommandHandler("fp", fp.render) Link to comment
Recommended Posts