Jump to content

how to change camera...?


12p

Recommended Posts

Posted

I want to make a RE4 camera... But I don't know how to make it well. I have this idea:

  
player = getLocalPlayer() 
x,y,z = getElementPosition (player) 
  
  
function updateCamera () 
 x,y,z = getElementPosition (player) 
 setPedAimTarget (player,x,y+100,z) 
 rx,ry,rz = getPedTargetEnd (player) 
 setPedAimTarget (player,rx,ry+100,rz+0.7) 
 setCameraMatrix (x+0.5,y-0.5,z+0.7,rx-0.1,ry,z+0.4) 
end 
  
setTimer (updateCamera,50,0) 
  

But there are 2 bugs. Player "moves" along the camera, and if I aim, the camera rotates in its point. Help me to solve it, please.

Posted

why you don't use onClientRender since the script its client side,

  
player = getLocalPlayer() 
x,y,z = getElementPosition (player) 
  
  
function updateCamera () 
 x,y,z = getElementPosition (player) 
 setPedAimTarget (player,x,y+100,z) 
 rx,ry,rz = getPedTargetEnd (player) 
 setPedAimTarget (player,rx,ry+100,rz+0.7) 
 setCameraMatrix (x+0.5,y-0.5,z+0.7,rx-0.1,ry,z+0.4) 
end 
addEventHandler("onClientRender",getRootElement(),updateCamera) 

for me i think its much better ;)

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I Think for camera he will need onClientPreRender event ..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Sorry, got no idea what an RE4 camera is (resident evil 4?), but I'm basing the following code on previous posts;

  
local GLP = getLocalPlayer() 
function updateCamera () 
 x,y,z = getElementPosition (GLP) 
 setPedAimTarget (GLP,x,y+100,z) 
 rx,ry,rz = getPedTargetEnd (GLP) 
 setPedAimTarget (GLP,rx,ry+100,rz+0.7) 
 setCameraMatrix (x+0.5,y-0.5,z+0.7,rx-0.1,ry,z+0.4) 
end 
addEventHandler("onClientPreRender",getRootElement(),updateCamera) 

Retired

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