qaisjp Posted March 8, 2011 Share Posted March 8, 2011 I wonder if anyone can give me / make a script that does this? I don't exactly wan't it to show this when the main menu is shown so if you are making it there is no need to implement it. However if you already have the full code and don't mind giving it to me I will be obliged for your help ( I will edit it if you have the full code). I believe Zango has this, correct me if i am wrong. I tried the below but it wouldn't work (it would go all orangy and weird as if it was outside the game engine, which it is not) So that is why I request this script instead setCameraMatrix ( -3899.1423339844, 1324.7391357422, 7446 , -3899.1423339844, 1324.7391357422, 7460, 20, 170) My friend put a map up there and when I go there using /sp it works fine. Link to comment
Moderators Citizen Posted March 8, 2011 Moderators Share Posted March 8, 2011 I think that he uses a bindKey to detect if the player go back to the menu And before he replaced his background of the menu by a transparent image manually So when the player press the key, he starts the function which move the camera. Link to comment
qaisjp Posted March 8, 2011 Author Share Posted March 8, 2011 Thanks for trying to help, but I am not interested in the main menu, I'm interested in the camera Cos I need the script for the movement of camera etc Link to comment
Moderators Citizen Posted March 8, 2011 Moderators Share Posted March 8, 2011 Try to put a setTimer( addMoreX, 50, 0 ) for move your camera mouthly in the X axis: local x, y, z, x2, y2, z2 = getCameraMatrix( thePlayer ) setCameraMatrix( x+0.5, y, z, x2, y2, z2 ) You can make an addMoreY too but you have to add 0.5 to the Y axis Try to make it and if you can't make that, I will try to make it But try first Link to comment
qaisjp Posted March 8, 2011 Author Share Posted March 8, 2011 Works beautifully <3 function moveCam(NewX,NewY,NewZ) if (getElementData(getLocalPlayer(), "gamemode") == false) then local x, y, z, x2, y2, z2 = getCameraMatrix( thePlayer ) if not NewX then NewX = 0 end if not NewY then NewY = 0 end if not NewZ then NewZ = 0 end setCameraMatrix( x+NewX, y+NewY, z+NewZ, x2, y2, z2 ) else killTimer(CamTimer) end end addEventHandler("onClientResourceStart", getResourceRootElement(), function() if (getElementData(getLocalPlayer(), "gamemode") == false) then -- Init the camera. fadeCamera(true, 1.0, 0, 0, 0) setCameraMatrix(-1451.81, -338.69, 14.71, -1413.49, -297.85, 25.43) --setCameraMatrix ( -3899.1423339844, 1324.7391357422, 7446 , -3899.1423339844, 1324.7391357422, 7460, 20, 170) CamTimer = setTimer(moveCam, 50, 0, 0.5, 0.5, 0.1) setTime(0,0) setWeather(9) end end ) Now the basic thing work's, now do you have any idea of a good place to circulate on :3? 1 Link to comment
Moderators Citizen Posted March 8, 2011 Moderators Share Posted March 8, 2011 Maybe, it's in LS ? If it's in LS, you can move the camera near the VINEWOOD sign ? and maybe near the police station ? Link to comment
Discord Moderators Zango Posted March 8, 2011 Discord Moderators Share Posted March 8, 2011 fyi I used moveObject + getElementPosition + setCameraMatrix you can do your own equation to calculate time of object movement by speed and distance. Create a timer with same value and design a table with route checkpoints. as a bonus note, setting a player's camera matrix elsewhere will have the world around him unloaded, so he'll fall in underground SA when you restore his target. sometimes doing setElementPosition once isn't sufficient either, so you need to "force" it, something like this: repeat until setElementPosition (player, x, y, z) end Link to comment
qaisjp Posted March 9, 2011 Author Share Posted March 9, 2011 Actually we have a custom event "spawnThePlayer" which contain's the following amongst other things. repeat until spawnPlayer(bunch of arg's) The only problem is that the timer doesn't stop even when theplayer's element data "gamemode" is NOT false. And yes, it does change from false, to a string in fact ( "none", "freeroam", "stunt" etc...) I think the killing of the timer doesnt work >.< Zango: So you get the element position of the player, set his camera matrix + 20 (or sumtin), then set a timer to move the camera? and then kill it after? Thank's for the tip too Link to comment
Discord Moderators Zango Posted March 9, 2011 Discord Moderators Share Posted March 9, 2011 Zango: So you get the element position of the player, set his camera matrix + 20 (or sumtin), then set a timer to move the camera? and then kill it after? Thank's for the tip too As I said, I use moveObject I move an invisible object along some coordinates and use getElementPosition on the object in setCameraMatrix Link to comment
qaisjp Posted May 4, 2011 Author Share Posted May 4, 2011 Oh cool, so you move the object and set the camera matrix to the object location Link to comment
H5N1 Posted May 4, 2011 Share Posted May 4, 2011 Use it: https://wiki.multitheftauto.com/wiki/FindRotation https://wiki.multitheftauto.com/wiki/Get ... ceRotation Link to comment
qaisjp Posted May 6, 2011 Author Share Posted May 6, 2011 H5N1, it is fine now, I think i have got it done. I finished it before you posted, thanks for your help tho. Link to comment
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