manve1 Posted December 29, 2012 Posted December 29, 2012 Is there a problem with setCameraTarget? Because i tried it and it didn't set my camera to a vehicle which was created via server side (( if u think i done something wrong, please post suggestion about how the script should look for the camera to be attached to a vehicle that was created via server side )) Looking for tutorials or information? check out: www.simpleask.co.uk
50p Posted December 29, 2012 Posted December 29, 2012 This function allows you to set a player's camera to follow other elements instead. Currently supported element type is:- Players - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
manve1 Posted December 29, 2012 Author Posted December 29, 2012 So is there any way i can set a players camera to follow a vehicle? Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 29, 2012 Posted December 29, 2012 You can use setCameraMatrix. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 29, 2012 Author Posted December 29, 2012 how could i use it to set camera to follow a vehicle? Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 29, 2012 Posted December 29, 2012 For what do you need the camera to follow a vehicle? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 29, 2012 Author Posted December 29, 2012 I have a script and i need a player which hit a marker camera to follow a server-sided created vehicle Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted December 29, 2012 Posted December 29, 2012 You'll need to make your own function, which will require maths if I'm right, to get the right position for the camera. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 29, 2012 Author Posted December 29, 2012 Could you help me? as i never made my own function Looking for tutorials or information? check out: www.simpleask.co.uk
Cadu12 Posted December 29, 2012 Posted December 29, 2012 Just copy it from Race gamemode, which it has. Ingame nick: Cadu12
Castillo Posted December 29, 2012 Posted December 29, 2012 Race uses setCameraTarget with vehicle's driver. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted December 29, 2012 Author Posted December 29, 2012 I need it for a vehicle, when no one is in it Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 If you have any knowledge about math it should not be hard to get the position. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 I got that part Anderl, but what functions do i must use ? Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 If you have the position of the vehicle, the only functions you need are setCameraMatrix and Lua math functions ( may not be needed ) and the event onClientRender to update camera. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 onClientRender is a client sided script and my vehicle was created on server-side, so how could this work out? Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 I didn't remember that, use setTimer instead. I don't know if that's the most efficient way, though. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 Bad argument @ setCameraMatrix local x, y, z = getElementPosition( source ) veh = createVehicle( 519, x + 15, y, z, 0, 0, 180 ) setTimer( function() if isElement(veh) then local xVeh, yVeh, zVeh = getElementPosition( veh ) setCameraMatrix( source, xVeh, yVeh, zVeh ) end end, 50, 0 ) Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 There is no source in your code. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 source should be standing for getRootElement(), but as i remember it gets every single element, so how could i change it? Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 Source is not root. Just use the player element in the one you want to set camera matrix. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 EDIT: Solved, thanx guys Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 You're welcome. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
manve1 Posted December 29, 2012 Author Posted December 29, 2012 Last question: How can i rotate the camera to sides? Looking for tutorials or information? check out: www.simpleask.co.uk
Anderl Posted December 29, 2012 Posted December 29, 2012 Change Z Position. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now