LiOneLMeSsI Posted November 19, 2013 Share Posted November 19, 2013 Hello Guys I'm wanted to make camera in login panel...like makes camera moves aro und the city and shows the places. Which functions i have to use? and may you give me an Example? AND THAAAAAAAANKS A LOT!!! Link to comment
csiguusz Posted November 19, 2013 Share Posted November 19, 2013 onPlayerJoin --event --then setCameraMatrix --for moving use the above function with this event: onClientPreRender Link to comment
LiOneLMeSsIShoT Posted November 19, 2013 Share Posted November 19, 2013 onPlayerJoin --event --then setCameraMatrix --for moving use the above function with this event: onClientPreRender Actually!! Yea Right it Helped Much...but actually it's only setCameraMatrix...and i need the camera moves....not only looks in one Positions...Means i want it to switch the position...I hope you got it I use this function setCameraOnPlayerJoin() fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) Link to comment
Castillo Posted November 19, 2013 Share Posted November 19, 2013 So, you got a list of camera locations and you want it to set a random one from that table? Link to comment
LiOneLMeSsIShoT Posted November 19, 2013 Share Posted November 19, 2013 So, you got a list of camera locations and you want it to set a random one from that table? I want the camera Show all locations ..like when the camera show the location..it shows the another while the camera's moving. Link to comment
LiOneLMeSsIShoT Posted November 19, 2013 Share Posted November 19, 2013 So, you got a list of camera locations and you want it to set a random one from that table? I want the camera Show all locations ..like when the camera show the location..it shows the another while the camera's moving. ALright look. function setCameraOnPlayerJoin() fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) setCameraMatrix(source, 2941.5, -2051.6999511719, 3.2999999523163, 12, 0, 270) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) I have added 2 Locations...and Only one work..i want the both work...like one work...after 3 seconds the another work...Understand what i mean... Link to comment
Castillo Posted November 19, 2013 Share Posted November 19, 2013 You must use timers and tables. Link to comment
LiOneLMeSsIShoT Posted November 19, 2013 Share Posted November 19, 2013 You must use timers and tables. Alright..could you help me with this? like give me an example.. Link to comment
Castillo Posted November 19, 2013 Share Posted November 19, 2013 viewtopic.php?f=91&t=55259&p=533972 That topic should be enough. Link to comment
Desaster Posted November 19, 2013 Share Posted November 19, 2013 you could create an object an create an object and move it wile the camera looks to it that also looks cool also remember to turn the alpha and the collision of the object to 0 , false Link to comment
LiOneLMeSsIShoT Posted November 23, 2013 Share Posted November 23, 2013 you could create an object an create an object and move it wile the camera looks to it that also looks cool also remember to turn the alpha and the collision of the object to 0 , false Yea i could "createObject" and "moveObject" True but how i make the player camera be on the object? Link to comment
denny199 Posted November 23, 2013 Share Posted November 23, 2013 https://wiki.multitheftauto.com/wiki/SmoothMoveCamera Link to comment
LiOneLMeSsIShoT Posted November 23, 2013 Share Posted November 23, 2013 https://wiki.multitheftauto.com/wiki/SmoothMoveCamera Can you give me an example? because the example in wiki didn't help enough Link to comment
denny199 Posted November 23, 2013 Share Posted November 23, 2013 Nevermind, i tought that you wanted to move the camere from one place to anothe with interpolating, use Solidsnake's one: local camTable = { { 1262, -1154, 96,1190, -1195, 58 }, --cs,cy,cz,cpx,cpy,cpz { 512.2, -1263.57, 32.53,542.16, -1287.07, 17.24 } } local cameras = { } function firstSlider ( ) cameras [ source ] = 0 setTimer ( function ( thePlayer ) cameras [ thePlayer ] = ( cameras [ thePlayer ] + 1 ) setCameraMatrix ( thePlayer, unpack ( camTable [ cameras [ thePlayer ] ] ) ) fadeCamera ( thePlayer, true, 1 ) end, 1000, 2, source ) end addEventHandler ( "onPlayerLogin", getRootElement(), firstSlider ) Link to comment
LiOneLMeSsIShoT Posted November 23, 2013 Share Posted November 23, 2013 Nevermind, i tought that you wanted to move the camere from one place to anothe with interpolating, use Solidsnake's one: local camTable = { { 1262, -1154, 96,1190, -1195, 58 }, --cs,cy,cz,cpx,cpy,cpz { 512.2, -1263.57, 32.53,542.16, -1287.07, 17.24 } } local cameras = { } function firstSlider ( ) cameras [ source ] = 0 setTimer ( function ( thePlayer ) cameras [ thePlayer ] = ( cameras [ thePlayer ] + 1 ) setCameraMatrix ( thePlayer, unpack ( camTable [ cameras [ thePlayer ] ] ) ) fadeCamera ( thePlayer, true, 1 ) end, 1000, 2, source ) end addEventHandler ( "onPlayerLogin", getRootElement(), firstSlider ) Yes man i want to move the camera from place to another with moveObject...not just photos..i mean like VIdeo... Link to comment
denny199 Posted November 23, 2013 Share Posted November 23, 2013 What can't you understand in this: local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 setTimer ( removeCamHandler, time, 1 ) setTimer ( destroyElement, time, 1, sm.object1 ) setTimer ( destroyElement, time, 1, sm.object2 ) return true end Just put this on the client side with the codes provided above: addEventHandler ( "onClientResourceStart", resourceRoot, function() smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time ) end) Just fill in the values... 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