likemike12 Posted May 16, 2016 Share Posted May 16, 2016 السلام عليكم ورحمة الله وبركاته الكود setCameraMatrix(player,2882.107421875,1790.0267333984,31.395790100098,2892.6208496094,1790.8303222656,30.195960998535,0,70) setTimer ( function() smoothMoveCamera ( 2882.107421875, 1790.0267333984, 31.395790100098, 2899.0109863281, 1789.5551757813, 28.845014572144, 2897.8354492188, 1794.3680419922, 28.154830932617, 2884.443359375, 1785.1320800781, 28.596536636353, 2000) end, 2000, 1) مشكلته بالصوره وشكراً Link to comment
#|_oskar_|# Posted May 16, 2016 Share Posted May 16, 2016 جطه الكود دا ب اول الملف local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) 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") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end Link to comment
likemike12 Posted May 16, 2016 Author Share Posted May 16, 2016 جطه الكود دا ب اول الملف local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) 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") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end اخي ما تتحرك الحين التايمر فيه مشكله @@ Link to comment
likemike12 Posted May 16, 2016 Author Share Posted May 16, 2016 شباب حد يساعدني ما تتحرك الكاميرا وما يكتبلي انه فيها مشاكل Link to comment
3NAD Posted May 16, 2016 Share Posted May 16, 2016 اطرح الكود كامل "اللي توصلت له بعد المحاولات" ء Link to comment
likemike12 Posted May 17, 2016 Author Share Posted May 17, 2016 اطرح الكود كامل "اللي توصلت له بعد المحاولات" ء local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) 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") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end function removeColorCodeFromString (string) if ( string ) then return string.gsub(string,"#%x%x%x%x%x%x","") else outputDebugString("No string.",1) return "" end end addEvent("removeCode",true) addEventHandler("removeCode",root, function(player,name) setPlayerName(player,removeColorCodeFromString(name)) end) addEvent("Login",true) addEventHandler("Login",root, function(player,username,password) local acc = getAccount(username,password) if acc then logIn(player,acc,password) triggerClientEvent(player,"AccC",player) setCameraMatrix(player,2882.107421875,1790.0267333984,31.395790100098,2892.6208496094,1790.8303222656,30.195960998535,0,70) setTimer ( function() smoothMoveCamera ( 2882.107421875, 1790.0267333984, 31.395790100098, 2899.0109863281, 1789.5551757813, 28.845014572144, 2897.8354492188, 1794.3680419922, 28.154830932617, 2884.443359375, 1785.1320800781, 28.596536636353, 2000) end, 2000, 1) else triggerClientEvent(player,"notAcc",player) end end) هذا الكود جزء من القيم مود تبعي بس الكاميرا كذا ما تتحرك ولا يكتبلي فيها مشاكل Link to comment
#|_oskar_|# Posted May 17, 2016 Share Posted May 17, 2016 local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) 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") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end ----------------- smoothMoveCamera ( 2882, 1790, 31, 2899, 1789, 28, 2897, 1794, 28, 2884, 1785, 28, 2000) Link to comment
likemike12 Posted May 17, 2016 Author Share Posted May 17, 2016 local sm = {} sm.moov = 0 sm.object1,sm.object2 = nil,nil local function removeCamHandler() if(sm.moov == 1)then sm.moov = 0 end end local function camRender() if (sm.moov == 1) then local x1,y1,z1 = getElementPosition(sm.object1) local x2,y2,z2 = getElementPosition(sm.object2) setCameraMatrix(x1,y1,z1,x2,y2,z2) end end addEventHandler("onClientPreRender",root,camRender) 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") sm.moov = 1 setTimer(removeCamHandler,time,1) setTimer(destroyElement,time,1,sm.object1) setTimer(destroyElement,time,1,sm.object2) return true end ----------------- smoothMoveCamera ( 2882, 1790, 31, 2899, 1789, 28, 2897, 1794, 28, 2884, 1785, 28, 2000) الكاميرا واقفه ما تتحرك حد يعطيني الكود لاي كاميرا بأي مكان المهم تتحرك المهم اتعلم منها بدل الاجوبه الخاطئه Link to comment
likemike12 Posted May 17, 2016 Author Share Posted May 17, 2016 عالاقل حد يشرحلي الموضوع Link to comment
#|_oskar_|# Posted May 17, 2016 Share Posted May 17, 2016 عدل ع الاحداثيات مسوي لى الاحداثيات بنفس المكان وتقول ماتتحرك واجوبه خاطئه Link to comment
likemike12 Posted May 17, 2016 Author Share Posted May 17, 2016 عدل ع الاحداثيات مسوي لى الاحداثيات بنفس المكان وتقول ماتتحرك واجوبه خاطئه يا اخي انتبه للاحداثيات @@ Link to comment
#|_oskar_|# Posted May 17, 2016 Share Posted May 17, 2016 ان شاء الله تفهم من الشرح دا local x1,y1,z1 = 2505,-1658,14 --- احداثيات البدايه local x2,y2,z2 = 2202,-1653,102 --- احداثيات النهايه local rot1 = 0 --- الدوران عند بدء الكاميرا local rot2 = 7000 ---الدوران عند انتهاء الكاميرا local Speed = 5000 --- سرعة الكاميرا smoothMoveCamera (x1,y1,z1,rot1,0,0,x2,y2,z2,rot2,0,0,Speed) 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